dataset and sort

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sehboo

    #1

    dataset and sort

    I call a stored procedure and get the data in dataset then I do this
    to sort my data
    myDS.Tables[0].Select("" , "terminal DESC");

    but it doesn't sort. If I put something in filter then it totally
    ignors that as well...am I missing something?

  • sloan

    #2
    Re: dataset and sort


    You gotta set a variable to the results


    DataRow [] rows = ds.Tables[0].Select("" , "terminal DESC");

    then loop on the rows, cast them if necessary (for a strongly typed dataset)




    "Sehboo" <MasoodAdnan@gm ail.comwrote in message
    news:1188928525 .542318.42880@y 42g2000hsy.goog legroups.com...
    >I call a stored procedure and get the data in dataset then I do this
    to sort my data
    myDS.Tables[0].Select("" , "terminal DESC");
    >
    but it doesn't sort. If I put something in filter then it totally
    ignors that as well...am I missing something?
    >

    Comment

    • Nicholas Paldino [.NET/C# MVP]

      #3
      Re: dataset and sort

      Sehboo,

      Instead of calling Select, you should use a DataView and set the Sort
      property to "terminal DESC".

      --
      - Nicholas Paldino [.NET/C# MVP]
      - mvp@spam.guard. caspershouse.co m

      "Sehboo" <MasoodAdnan@gm ail.comwrote in message
      news:1188928525 .542318.42880@y 42g2000hsy.goog legroups.com...
      >I call a stored procedure and get the data in dataset then I do this
      to sort my data
      myDS.Tables[0].Select("" , "terminal DESC");
      >
      but it doesn't sort. If I put something in filter then it totally
      ignors that as well...am I missing something?
      >

      Comment

      Working...