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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Navigating Data

Status
Not open for further replies.

jpspring

Programmer
Oct 6, 2000
25
GB
Whats the best way of moving around a dataset, presumably you cant do it with a data reader because its forward only or is there a way to reset the data reader to the start of the records after it has gone through once
 
Once the dataset is loaded (through a DataAdapter) you can navigate through the Tables contained within it.
 
is there another of doing it other than the databindings method to go through the records
 
If you have a DataSet, then it'll contain a Tables collection. You can navigate through that DS.Tables(0) just like you would any DataTable, with a For Each loop, etc. DS.Tables(0).Rows(0) to get the first row, etc. You would use the bindingcontext if you want to know which row is the one the currently being edited by the controls you have bound to it.
 
G'day,

I'm actually trying to work out the best way to reset a datareader, as I don't want to have to store the records in a dataset. Is there a way to reset a datareader? otherwise I will just close it and reinstantiate it. The reason I am avoiding the dataset is to save memory and for the speed of the datareader. If anyone can clear this up I will appreciate it very much. Thanks
 
close it and reinstantiate, would be your best bet.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top