Sql, Tables and ComboBoxes

Discussion in 'Questions (Windows Mobile)' started by Cableguy, Nov 16, 2008.

  1. Cableguy

    Cableguy Expert Licensed User

    Hi guys...


    I have a table control wich holds data from an sql table...
    This table looks like this:

    | Type | Brand | Model |

    Type and Brand can have the same value over many records, like this:

    | 2 collumns Elevator | Konni | KO4020
    | 2 collumns Elevator | Nusbaum| SL2.30
    | 4 collumns Elevator | Konni | KO4040
    | 4 collumns Elevator | Nussbaum | SL4.50

    How can I populate a ComboBox with unique Types or Brands?
    in this case with only 1 entry "Konni" and 1 entry "Nussbaum".
     
  2. Ricky D

    Ricky D Well-Known Member Licensed User

    try this

    gday mate, try this

    Code:
    cmd.CommandText="Select Brand From tablename Group By Brand Order By Brand Asc"
    reader.Value=cmd.ExecuteReader
    while reader.ReadNextRow=true
    combo.add(reader.GetValue(
    0))
    loop
    regards, Ricky
     
Loading...
  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