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!

ADO.NET DataSet Navigation

Status
Not open for further replies.

Developerman2000

Programmer
Dec 9, 2002
10
GB
I hope someone can help!!!!

I am trying to navigate between a Access DB using ADO.net and Datasets, for example if I press the next button the next record in the DB will be displayed in the relevent textbox.

The code below is my attempt but I need some help to get it working

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'For Each tblBookSearch In dsBookSearch.
Dim dscustomers As DataSet = New DataSet()
Dim tblcustomer As DataTable = New DataTable()

For Each tblcustomer In dscustomers.Tables
Dim rowcust As DataRow
For Each rowcust In tblcustomer.Rows
Dim colcust As DataColumn
For Each colcust In tblcustomer.Columns
Console.WriteLine(rowcust(colcust))
Next colcust
Next rowcust

Many Thanks to anybody who comes to my rescue!!!!!!
 
declare this
public static iRowIndex as integer

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'For Each tblBookSearch In dsBookSearch.

iRowIndex = iRowIndex + 1
Dim colcust As DataColumn
For Each colcust In tblcustomer.Columns
Console.WriteLine(iRowIndex (colcust))
Next colcust




 
for k=0 to ds.tables.count
for i=0 to ds.tables(k).rows.count
for j=0 to ds.tables(0).columns.count
msgbox (ts.tables(0).rows(i).item(j))
next j
next i
next k


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top