sort table in webservice

Discussion in 'ASP .Net' started by =?Utf-8?B?SUdvdFlvdXJEb3ROZXQ=?=, Aug 12, 2004.

  1. 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
    =?Utf-8?B?SUdvdFlvdXJEb3ROZXQ=?=, Aug 12, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?SUdvdFlvdXJEb3ROZXQ=?=

    Ben Lucas Guest

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

    --
    Ben Lucas
    Lead Developer
    Solien Technology, Inc.
    www.solien.com

    "IGotYourDotNet" <> wrote in message
    news:...
    > 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
    Ben Lucas, Aug 12, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nobody
    Replies:
    0
    Views:
    536
    nobody
    Jun 1, 2004
  2. JerryJ
    Replies:
    11
    Views:
    1,405
    Dave Moore
    Apr 28, 2004
  3. John Black
    Replies:
    6
    Views:
    2,059
    John Harrison
    May 28, 2004
  4. Navin
    Replies:
    1
    Views:
    690
    Ken Schaefer
    Sep 9, 2003
  5. Rick
    Replies:
    0
    Views:
    148
Loading...

Share This Page