Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm 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.

  • Leaders
Posted

You don't sort DataSets, you sort DataTables and DataViews. To do this just set the sort property to "dataofbirth".

ie.

myDataSet.Tables("myTableName").DefaultView.Sort = "dateofbirth"

--tim

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...