How to get rowID?

L

Levon Levonian

Hello All,

I have a problem with the Select() method of the datatable. I filter and
sort the DefaultView of the datatable and then from that filtered and sorted
table I extract one datarow at a time, I do like this:

Dim drTasks() As DataRow
drTasks = g_dsTasks.Tables("TasksToDo").Select("TaskID=14")

Now I have a datarow, however I must know what ID that row has in the
datatable. When I view drTasks array in the Watch window, I can see that
there is a
rowID property, which is exactly what I need!!! As I understand this rowID
value is the ID or the row in the table on which I did the Select().
However, when I write a statement:

Dim id As Integer = drTasks(0).rowID

then VS warns me that there is no such property as rowID. How can it be so?
in the Watch window it is there! Tell me please how to access that rowID
property.

Thank you,
Levon
 
M

Miha Markic [MVP C#]

Hi Levon,

Why do you need an ID in first place?
The row instance is unique and you might use it...
 

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

Top