469,317 Members | 1,894 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,317 developers. It's quick & easy.

how to get the index number of a row

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????

Nov 21 '05 #1
1 1225
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)

"Cordine" wrote:
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????

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Qiang Han | last post: by
25 posts views Thread by sql_server_2000_user | last post: by
14 posts views Thread by Sean C. | last post: by
29 posts views Thread by shmartonak | last post: by
12 posts views Thread by bernhard.willems | last post: by
2 posts views Thread by peter.prib | last post: by
8 posts views Thread by paii, Ron | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.