Looping through a dataset table

mike55

Well-known member
Joined
Mar 26, 2004
Messages
726
Location
Ireland
Hi

Have a dataset with a table in it. Need to loop through this table and select the value of cell(1) from the table.

Have tried the following
Code:
For Each selIndex In dsDataset.Tables(page).Columns(0)

Next
The error I am getting is:Expression is of type System.Data.DataColumn, which is not a collection type.

Mike55.
 
mike55 said:
Hi

Have a dataset with a table in it. Need to loop through this table and select the value of cell(1) from the table.

Have tried the following
Code:
For Each selIndex In dsDataset.Tables(page).Columns(0)

Next

Try this:

Code:
For Each dr As DataRow In dsDataset.Tables(page).Rows
    Debug.Print dr.Item(0).ToString()
Next
 
Back
Top