hi,
i create windows c# application. in which i put button like first,next, last,previous.
now i want to display record fetch from database , and show in page.
when i click first button then on load time data display first. when i click last then data display last record, when i click previous then data dispaly previous, and when i click next then display data next in c# windows application.
pls help me...
Vinay SinghPosted Jun 23, 2016, 5:52 AM
First:
SELECT TOP 1 * FROM MyTable WHERE Id > lastRow ORDER BY ID ASC
If you get any rows, load lastRow with the ID value.
For "Next" it's the same query.
For previous :
SELECT TOP 1 * FROM MyTable WHERE Id < lastRow ORDER BY ID DESC
First:
SELECT TOP 1 * FROM MyTable ORDER BY ID ASC
Last:
SELECT TOP 1 * FROM MyTable ORDER BY ID DESC
Jigar PatelPosted Jun 23, 2016, 5:36 AM
Vinay SinghPosted Jun 23, 2016, 4:18 AM
Paging in DataGridview Using C#.Net In Windows Application