getting records alphabetically

Discussion in 'Questions (Windows Mobile)' started by gjoisa, May 10, 2008.

  1. gjoisa

    gjoisa Active Member Licensed 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:
  2. Erel

    Erel Administrator Staff Member Licensed User

    You should add ORDER BY to your query:
    cmd.CommandText = "SELECT col1 ORDER BY col1 ASC"
  3. giannimaione

    giannimaione Well-Known Member Licensed User

    cmd.CommandText = "SELECT col1 ORDER BY col1 [B]DESC[/B]"
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice