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 SinghRank #604 · 4K reputationPosted Jun 23, 2016, 12:18 AM EDT
Paging in DataGridview Using C#.Net In Windows Application
Jigar Patel59 reputationPosted Jun 23, 2016, 1:36 AM EDT
Vinay SinghRank #604 · 4K reputationPosted Jun 23, 2016, 1:52 AM EDT
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