Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

Hi, is there a way to sort the contents of a dataset using a given column within that dataset?

 

I'm loading an xml file into a dataset with;

 

dsHighScores.ReadXml(objXValReader)

 

This gets my xml into the dataset but now I need to sort it?

 

Eh no it doesn't?

 

I have just found that altho I get 10 rows as expected I only get one column instead of two?

 

Any help muchly appreciated....:)

Edited by hog
My website
Posted (edited)

?

 

that just takes me to a long list?

 

Ignore me, it's late and I'm tired:(

 

Of course you mean "lookup system.data.datview"

 

:)

 

Thnx

Edited by hog
My website
Posted

Hi, OK almost there but not....:(

 

The sort method wants a string.

 

My table is Table(0)

The columns are therefore 0 and 1

 

But whether I use

 

dvDataView.Sort = 1

 

or

 

dvDataView.Sort = "1"

 

I get an error saying column 1 not found?

My website
Posted

Oh brother!

 

dvDataView.Sort = dsHighScores.Tables(0).Columns(1).ToString

 

Obviously!!

 

Thnx 4 the help Derek:)

 

Problem solved:):)

My website

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...