blanket
blanket

Reputation: 79

Dropdownlist data items displayed in alphabetical order

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

Answers (3)

RoMEoMusTDiE
RoMEoMusTDiE

Reputation: 4824

should be order by company name... so

SELECT  * FROM Table ORDER BY Company

Upvotes: 0

Zaki
Zaki

Reputation: 5600

ORDER BY [Company], [CompanyID] ASC

Upvotes: 0

Curtis
Curtis

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

Related Questions