how to order string logically

Posted by just_name on Stack Overflow See other posts from Stack Overflow or by just_name
Published on 2011-01-10T12:16:14Z Indexed on 2011/01/10 12:53 UTC
Read the original article Hit count: 155

Q:

I have the following case :

set of letters (grades) A,A+,A-,B,B+,B- stored as strings in the database i wanna to order these grades logically from the small one to the big one ,, but this not what happen in real.. because these are strings the order is:

A,A+,A- i wanna

ASC

A-,A,A+

DESC

A+,A,A-

i bind those grades in drop down list and i wanna these grades with this logical order in it..

is there any idea how to do something like this..

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET