Simple sort on a table...

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

    Simple sort on a table...

    I am adding this to my c#.Net app...
    How can I sort all rows in a table?
    After it is sorted, will it remain so after i do a cnSQL.Close();
    so that when I then do a:
    string strSQL = "SELECT InvoiceNumber " +
    "FROM tblPrintInvoice " ;
    Is it still sorted for me to do a:
    drSQL.Read?
    Thanks,
    Trint

  • David Portas

    #2
    Re: Simple sort on a table...

    You don't sort a table, you sort the result of a query. Use ORDER BY on
    your SELECT statement. That is the only reliable way to return rows in
    a pre-determined order.

    --
    David Portas
    SQL Server MVP
    --

    Comment

    • Trint Smith

      #3
      Re: Simple sort on a table...

      Thanks,
      That worked!

      .Net programmer
      trinity.smith@g mail.com

      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      Working...