hog Posted December 22, 2003 Posted December 22, 2003 (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 December 22, 2003 by hog Quote My website
*Gurus* Derek Stone Posted December 22, 2003 *Gurus* Posted December 22, 2003 [msdn]System.Data.DataView[/msdn] Quote Posting Guidelines
hog Posted December 22, 2003 Author Posted December 22, 2003 (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 December 22, 2003 by hog Quote My website
hog Posted December 23, 2003 Author Posted December 23, 2003 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? Quote My website
hog Posted December 23, 2003 Author Posted December 23, 2003 Oh brother! dvDataView.Sort = dsHighScores.Tables(0).Columns(1).ToString Obviously!! Thnx 4 the help Derek:) Problem solved:):) Quote My website
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.