Pomster
Pomster

Reputation: 15197

How to do a for each for the rows in a datasets table?

Hi I am trying to loop though the rows in a table of my dataset.

I am a C# developer and have been given a VB project so i am struggling with the For each below.

Could someone please tell me what is wrong with the line of code below?

 For Each Row as DataRow in dataset.Tables[0].Rows
    Do stuff//

Thanks in advance.

Upvotes: 3

Views: 45631

Answers (3)

Md. Parvez Alam
Md. Parvez Alam

Reputation: 4596

For Each dr As DataRow In ds.Tables(0).Rows
Next

Upvotes: 11

Manoj
Manoj

Reputation: 883

Well, you can convert your C# code to VB.NET using below URL . This could help you

http://www.developerfusion.com/tools/convert/csharp-to-vb/

Thanks

Upvotes: 1

Debajit Mukhopadhyay
Debajit Mukhopadhyay

Reputation: 4172

try this

For Each drow As datarow In dataset.tables(0).rows
Next

Upvotes: 1

Related Questions