How to navigate through DataSet, like Recordset ...

The easiest way is through a Forms BindingContext property. If youve bound your textbox like so:
C#:
// Text is the property on the TextBox control
// FirstName is a column in the DataTable Table1
textBox1.DataBindings.Add("Text", myDataSet.Tables["Table1"], "FirstName");

Then you can navigate forward/backwards like so:
C#:
this.BindingContext[myDataSet.Tables["Table1"]].Position++;

You can also create your own CurrencyManager, as Robby suggested. Especially if you need multiple "pointers" into the same DataTable.

-Nerseus
 
plus you have to change "++" to "+=1" or "-=1" depending on the direction you want to navigate to.

And yes Robby the CurrencyManager is a great deal.
Its worth a second and third glance.
 
Back
Top