finding a row number in a datatable for a column value

  • Thread starter Thread starter dee
  • Start date Start date
D

dee

hi,

I can do the above with the following code, but there must be more
efficient and easier way to do ? I have seen the find on the dataview
but i dont want to have to sort the view is there another way?

Dim i As Int16
Dim itemNO as string

For i = 0 To auctionList.Rows.Count - 1
If itemNo = auctionList.Rows(i).Item
(AuctionListColumns.ItemNo).ToString Then
row = i
End If
Next

Regards

David
 
Hi dee,

Iteration is the only way to find row index in DataTable.
Why do you need it, anyway?
 
Back
Top