Row Number

  • Thread starter Thread starter Jim Heavey
  • Start date Start date
J

Jim Heavey

If I have a Row from a dataTable, how do I get the row number of the row?

Thanks in advance for your assistance!!!!!
 
Hi Jim,

You cannot get index of the row. But, since your Row points to the actual
row in a datatable, sometimes it could help to find some workarounds. It
just depends on what you are tying to do
 
Hi Jim,

You can get the index of a row when you set it up in a manner that will
yield that index. For example, let's say you are trying to find custid
'00087' and then get that customer's address. You can do this is a multitude
of ways, but one of the most common is to use a dataview. Here's a skeleton
of it:
Dim arrayseeks(0) As Object

Dim ifinds As Integer

Dim vues As New DataView(dsshipcode.Tables(0))

vues.Sort = "shipcode"

arrayseeks(0) = "03"

ifinds = vues.Find(arrayseeks)

If ifinds <> -1 Then ' ie, found it

mdescrip = vues(ifinds)("descrip")

Else

mdescrip = ""

End If

ifinds is an integer - its number is the index of the datatable in the order
as specified. If you have any questions about this, let me know - I'll be
glad to help.

HTH,

Bernie Yaeger
 
Hi Jim,

I think that you are talking about row position in DataTable.
If so, then the only way is to do a nice for loop.
 
Back
Top