DataTable row number
Can i get the row number of one record from a DataTable, after searching it with it's find() method?
Thank you
Joaquim
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Simon66 pointsPosted Apr 6, 2007, 2:32 PM EDT
It seems to me that you can't retreive the row number from a DataRow, but if you create a new DataView according to your existing DataTable dans use it's Find method, it returns a row index.
For example :
DataView dv = new DataView(myDataTable); int rowIndex = dv.Find(myKey);
Hope this helps!
Simon