Iterate dataset

  • Thread starter Thread starter martin
  • Start date Start date
M

martin

hi,

I am using vb.net. I have wrote a data access class and one of my methods
returns a dataset.

I would like to iterate through this, although this is proving problematic
for me.

Can anybody please point out the addition that I would need to the follwoing
code.

For counter = 1 To ds.Tables(0).Rows.Count

Dim dr As DataRow

dr = ds.Tables(0).Rows(counter)

Next

I realise that a datareader is more efficient to iterate through but in this
case I would rather use a dataset.

any help is appreciated.

cheers

martin.
 
Hi

Iterating thorugh dataset means...

1) the tables it contain
2) the rows contained in the selected table
3) then the coulms of the selected row....

There are table colleection, Rows collection and coulmn collection
classes...
use any looping controls like for each, for next or even while....


You canuse them to iterate through all the records of a dataset.
 
Back
Top