getting records alphabetically

gjoisa

Active Member
Licensed User
Longtime User
I have developed a program with a sql database . I have added all records to a table first . then i added the records with required keyword to a list box . Here i am experincing the problem . Records displaying not in alphabetical order . how to display records in a listbox with alphabetical order ?:sign0085:
 

giannimaione

Well-Known Member
Licensed User
Longtime User
You should add ORDER BY to your query:
B4X:
cmd.CommandText = "SELECT col1 ORDER BY col1 ASC"

or
B4X:
cmd.CommandText = "SELECT col1 ORDER BY col1 [B]DESC[/B]"
:)
 
Top