Sorting ASP.NET Dataset

  • bannerpad
  • Novice
  • Novice
  • No Avatar
  • Joined: Mar 16, 2004
  • Posts: 18
  • Status: Offline

Post May 20th, 2004, 1:16 pm

Does anyone know how I can sort data from a dataset without using Dataview?

I want to send my dataset into XML with the dataset bring sorted. I know you can sort the dataset using dataview but is there any way to sort it without using dataview?
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post May 20th, 2004, 1:16 pm

  • Carnix
  • Guru
  • Guru
  • User avatar
  • Joined: Apr 28, 2004
  • Posts: 1099
  • Status: Offline

Post May 20th, 2004, 2:34 pm

How about just sorting it in the SQL?

Code: [ Select ]
dim cmd as SqlDataAdapter = new SqlDataAdapter("SELECT * FROM table WHERE something=somethingelse ORDER BY somefield DESC", dbcon)


then you can omit the view.sort call, I think.

I don't really know, to be honest... I've not really tried to output to an XML stream... if you're doing a web service, you can sort on the other end instead, since the XML object will build a recordset on that side from the XML stream (although this only applies if you're controlling both sides...)
.c

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 138 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.