Sortinga DATASET after it has been populated from an XML file (VB.NET)

yablonka

Member
Joined
May 19, 2003
Messages
14
Im trying to sort a dataset after I populated it with data using the readxml method.

Example: If my XML file looks something like this:

<request>
<firstname>First_Name</firstname>
<lastname>Last_Name</lastname>
<dateofbirth>2/10/1979</dateofbirth>
<address>
<street>Street_Name</street>
<zipcode>78212</zipcode>
</address>
</request>
<request>
.
.
.


I want the records to be sorted by "dateofbirth".

Thank you.
 
You dont sort DataSets, you sort DataTables and DataViews. To do this just set the sort property to "dataofbirth".
ie.
myDataSet.Tables("myTableName").DefaultView.Sort = "dateofbirth"
 
Back
Top