Iterate dataset

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.
 
M

Madan Nayak

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,078
Latest member
MakersCBDBlood

Latest Threads

Top