My solution is you can create a Stored procedure and pass the Start and ending row no.In your vb.net application you can store the start and end row no to be populated from db.
For example i have created one table called question.
create table Questions(
quid int,
questions nvarchar(100)
)
insert into Questions values(1,'MY 1st Questions')
insert into Questions values(2,'MY 2nd Questions')
insert into Questions values(3,'MY 3rd Questions')
insert into Questions values(4,'MY 4th Questions')
insert into Questions values(5,'MY 5th Questions')
insert into Questions values(6,'MY 6th Questions')
insert into Questions values(7,'MY 7th Questions')
insert into Questions values(8,'MY 8th Questions')
insert into Questions values(9,'MY 9th Questions')
insert into Questions values(10,'MY 10th Questions')
here is sample query to display the selected rows count
Declare @startno int,@endno int
set @startno=0
set @endno=3
SELECT *
FROM (
SELECT *, ROW_NUMBER() OVER (ORDER BY quid) AS rownos
FROM Questions
) AS q
WHERE q.rownos BETWEEN @startno AND @endno
the output will be like this.
1 MY 1st Questions 1
2 MY 2nd Questions 2
3 MY 3rd Questions 3
The same query to display next 3 records
Declare @startno int,@endno int
set @startno=4
set @endno=6
SELECT *
FROM (
SELECT *, ROW_NUMBER() OVER (ORDER BY quid) AS rownos
FROM Questions
) AS q
WHERE q.rownos BETWEEN @startno AND @endno
the output will be like this.
4 MY 4th Questions 4
5 MY 5th Questions 5
6 MY 6th Questions 6
In your vb.net application in button clicks you can increment and decrement the start and end row nos.