how to get the index number of a row

  • Thread starter Thread starter Cordine
  • Start date Start date
C

Cordine

i have the data row object & the data table object.
I want to determine what the index position of this datarow object is in the
containing table.

How can i determine this???

i.e,
using the row index number i can get hold of the row object
DIM oRow as DataRow = oDataTable.Rows(nIndex)

But can i work backwords,
using the oRow object, can i determine what nIdex is????
 
If you are using a DataView, you may provide your dataview with a Sort key.
Then make use of the following code to locate your DataRow
Dim dv as DataView = DataTableName.DefaultView
dv.Sort = "KeyName"
Dim i as integer = dv.Find(KeyValue)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top