By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,419 Members | 1,584 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,419 IT Pros & Developers. It's quick & easy.

Simple sort on a table...

P: n/a
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

Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
--

Jul 23 '05 #2

P: n/a
Thanks,
That worked!

.Net programmer
tr***********@gmail.com

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

This discussion thread is closed

Replies have been disabled for this discussion.