Navigating In Dataset

S

Sagheer

Hi.

Please forgive my ignorance but I was wondering if there
is any simple way to create a web form connected with the
the database and navigate ie, Next Record, Previous
Record, First and Last Record. Just like the ADO
Recordset....

I have done alot of research but found nothing so
far....Microsoft help says since it retreives everything
and stays in the memory, there is no need for navigating
the records in dataset....

Few solutions I found are very complex, It seems a major
requirement and very basic functionality for any recordset


Please help
 
H

Hermit Dave

Hi,
Yes that was a nice functionality as a part of ADO which was something i
didnot find very appealing when started using .NET
But with ADO.NET you have all sort of objects right from forward only
objects like DataReader to fully fledged ones like DataSet.
With dataset you can get the count of rows and just do a for loop. if you
know the current position then you can substract one or add one and do move
first or move last.
you can get the first one my [0] and last one by Rows.count -1.

You dont have implementation like you did in classic ADO but with ADO.net
its very flexible in terms of what you can achieve.

Hope this helps,

HD
 
V

vMike

One other solution is to add a column to the table in code called say
"RowNumber" and use a for each process to poplulate the column with 1,2,3
etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,263
Messages
2,571,062
Members
48,769
Latest member
Clifft

Latest Threads

Top