By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,815 Members | 1,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,815 IT Pros & Developers. It's quick & easy.

easy question (FOR EACH)

P: n/a
I want to iterate through a dataset. What is the best way to do this? Can
I do something like:

for each datarow in ds
do stuff

Or is there a better way?

Thanks for the information.

Brad
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Brad,

for each datarow in ds
do stuff

almost right
for each dr as datarow in ds.tables(0).rows
do stuff with dr

I hope this helps?

Cor
Nov 21 '05 #2

P: n/a
Sure did help. Thanks Cor
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:uK**************@TK2MSFTNGP11.phx.gbl...
Brad,

for each datarow in ds
do stuff

almost right
for each dr as datarow in ds.tables(0).rows
do stuff with dr

I hope this helps?

Cor

Nov 21 '05 #3

P: n/a
Try something like this

'replace table with your table and tablename with your tablename
'replace yourdataset with your dataset

dim temprow As DataRow

For Each temprow In table.Rows
YourDataset.Tables.tablename.ImportRow(temprow)
Next
Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.