Skip to content

DataTable row number

Joaquim Correia

Asked Apr 5, 2007, 2:27 PM EDT1 answer
Share
LinkedInX
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.

  • 0
    Hello,

    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
    0