Reputation: 79
How can I get the list of data items displayed in alphabetical order in Drop down? I used the OderBy and I did not get the results I wanted...plz help.
SelectCommand="SELECT [CompanyID], [Company] FROM [Company] ORDER BY [CompanyID], [Company] DESC">
<SelectParameters>
Upvotes: 1
Views: 968
Reputation: 4824
should be order by company name... so
SELECT * FROM Table ORDER BY Company
Upvotes: 0
Reputation: 103358
Order by Company
first:
ORDER BY [Company], [CompanyID]
You're currently ordering by CompanyID
(which I assume is a primary key integer), and then Company DESC
. This means it will order the records by the numerical CompanyID
, then any which are matching (which I doubt would), would then be ordered by the Company Name, Z-A.
Upvotes: 2