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
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.
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.