Data row...

  • Thread starter Thread starter VJ
  • Start date Start date
V

VJ

When I am looping through a collection of rows in a dataset using a For Each
statment, how will know my rownumber for the row... This is assuming I don't
have a numbered column in my row..

Dim tbTable As DataTable = dsDataSet.Tables("Table1")
Dim rwRow As DataRow

For Each rwRow In tbTable.Rows

' How do I get the row number that is currently being processed here

Next

Thanks
VJ
 
Hi VJ,

Use
for i as integer = 0 to dsDataset.Tables("Table1").rows.count-1
dim dr as datarow = dsDataset.Tables("Table1").rows(i)
'instead
next

I hope this answers your question?

Cor
 
aah... got it..,

Thanks
VJ

Cor Ligthert said:
Hi VJ,

Use
for i as integer = 0 to dsDataset.Tables("Table1").rows.count-1
dim dr as datarow = dsDataset.Tables("Table1").rows(i)
'instead
next

I hope this answers your question?

Cor
 
Back
Top