sort table in webservice

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a service that calles a SP and I need a column sorted for one
application.. Can I do the sorting via the web service or no? I'm not using
straight SQL for the call, i'm calling a stored procedure
 
If you're retrieving the results into a DataTable or DataSet, you can use
the DataView object to sort. For example, given a DataTable dt with 2
columns ("ID" and "Column_To_Sort"), the following code could sort it:

DataView dv = new DataView(dt);
dv.Sort = "Column_To_Sort";

Now as you iterate through the rows in the DataView, it will be sorted on
the column "Column_To_Sort".
 
Back
Top