Sample table 'table':
| table1 ---- | ---- table2 | ---- table3 ---- |
| ------------ | ------------ | ---------------- |
| User ------ | 5000 ----- | -15-02-2016 |
| admin ---- | 3500 ----- | -18-03-2016 |
| guest ----- | 2000 ----- | -15-02-2016 |
I make a request:
SELECT * FROM table WHERE CONVERT(VARCHAR(10),table3,102) LIKE CONVERT(VARCHAR(10),15-02-2016,102) The request gives me:
|User------| 5000-----|-15-02-2016| |guest-----| 2000-----|-15-02-2016| In fact, the query gives me a lot more rows and I need to loop through each row of this query and work on the data obtained. For ease of understanding, I'll write a little clearer
for (int i = 0; i <= _selectedRowCount- 1; i++) { string s= //тут данный с столбца table1 i строки запроса int ammount=//тут данный с столбца table2 i строки запроса // //... работа с полученными данными // } How can you realize something like this? In general, you need to go through each line of the request in turn. The processed data is transmitted to an external source. More precisely in Excel.