Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sort DataTable 3

Status
Not open for further replies.

anrver

Programmer
Jun 24, 2002
12
0
0
CH
Hi,
I want to sort a datatable and read the contents.
I already tried the the following :

ds.Tables("Details").DefaultView.Sort = "Order"
For Each row In ds.Tables("Details").Rows
...
Next

But this doesn't work.
Can anyone help me ?




Erik Verstichel
Panalpina World Transport.
Antwerp, Belgium
 
A good little trick is to use the select command with no filter, and to specify the second parameter as the sort criteria

Code:
for each r as Datarow in ds.tables("Details").Select("","Order")
next


Sweep
...if it works dont f*** with it
...if its f****ed blame someone else
...if its your fault that its f***ed, say and admit nothing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top