Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Traverse all records in dataset (ado.net)

Status
Not open for further replies.

drluggo

Programmer
Jan 14, 2003
39
US
I am new to ADO.NET and I am familiar with ADO. I can create a dataset in ADO.NET by connecting and creating a data adapter and filling my dataset.

Now that I have this data I want to trverse all records in the dataset unitl EOF. In ADO, I would have done this with a recordset like:

rs.MoveFirst
Do While (Not (rs.EOF))
.....
rs.MoveNext
Loop

How do I do this with a dataset in ADO.NET???
 
for i=0 to ds.tables(0).Rows.Count -1
your code
next

depends on how many recordsets(tables) u bring back in ur dataset for multiple you would have to do another loop for each table in dataset

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top