J
Jason Callas
I have a datatable. I know I can call the method dt.Item(n) to get nth row.
What I need to do is, given a DataRow object, retrieve the row number. Look
at the sample code.
Dim dt As New DataTable
dt.Columns.Add(New DataColumn("symbol"))
Dim row As DataRow
row = dt.NewRow
row("symbol") = "MSFT"
dt.Rows.Add(row)
row = dt.NewRow
row("symbol") = "AAPL"
dt.Rows.Add(row)
For Each row In dt.Rows
Debug.WriteLine("The symbol " & row.Item("symbol").ToString() & " is
row...")
Next
Thanks,
Jason
What I need to do is, given a DataRow object, retrieve the row number. Look
at the sample code.
Dim dt As New DataTable
dt.Columns.Add(New DataColumn("symbol"))
Dim row As DataRow
row = dt.NewRow
row("symbol") = "MSFT"
dt.Rows.Add(row)
row = dt.NewRow
row("symbol") = "AAPL"
dt.Rows.Add(row)
For Each row In dt.Rows
Debug.WriteLine("The symbol " & row.Item("symbol").ToString() & " is
row...")
Next
Thanks,
Jason