Retrieving index for a particular row from dataset

G

Guest

Hello All,

Was wondering if we could retrieve the index of a particular row from a
dataset's table based on the filter criteria for the row?

For example, I have 4 rows in my datatable which is inside a dataset. One of
the columns is "ID" field. If I want to retrieve the row index of a row with
ID = 10, is there any API which I could use in .NET framework.

I am using a kinda beginners code to compare each and every row's ID in a
for loop and deriving the index. If my datatable has >10000 rows, this
procedure is very inefficient.

Is there any efficient way to retrieve a row index?

TIA,
Diffi
 
C

Craig Deelsnyder

Hello All,

Was wondering if we could retrieve the index of a particular row from a
dataset's table based on the filter criteria for the row?

For example, I have 4 rows in my datatable which is inside a dataset.
One of
the columns is "ID" field. If I want to retrieve the row index of a row
with
ID = 10, is there any API which I could use in .NET framework.

I am using a kinda beginners code to compare each and every row's ID in a
for loop and deriving the index. If my datatable has >10000 rows, this
procedure is very inefficient.

Is there any efficient way to retrieve a row index?

TIA,
Diffi

Is the sort based on "ID"? If so, you can use a DataView:

http://groups-beta.google.com/group...ca28c?q=datarow+index&rnum=8#e211bccc202ca28c
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top