ottenm
asked on
how to access DataTable rows, as ordered by DefaultView?
I am not able to influence the construction of a certain DataTable. To display it's contents, I set an "order by" clause into table1.DefaultView.Sort. Everything is good in the gui (asp.net DataGrid), but I am having trouble accessing the records programmatically in that same sorted order.
Is there a way to actually sort the records in the DataTable?
Thanks for any help-
VS 2003
Is there a way to actually sort the records in the DataTable?
Thanks for any help-
VS 2003
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Found it, could also use for each:
Dim v As DataView = table1.DefaultView
While i < v.Count - 1
Dim row As DataRowView = v.Item(i)
Dim val As String = row("ColumnName")
'etc.
End While
ASKER
What's the right thing to do if you answer your own question?
ASKER