Sql, Tables and ComboBoxes

Cableguy

Expert
Licensed User
Longtime 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".
 

Ricky D

Well-Known Member
Licensed User
Longtime User
try this

gday mate, try this

B4X:
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
 
Top