Hello,
Here is my scenerio,
I am trying to fil prefill multiple comboboxes.
All the data is from a single table
select distinct(booknum)from msdsmain;
select distinct(suppliername) from msdsmain;
select distinct(category) from msdsmain;
select distinct(productname) from msdsmain;
select distinct(infophone) from msdsmain;
select distinct(emerphone) from msdsmain
I need to fill 6 comboboxes with the data from each query. I tried to make all the queries into a single string:
Dim strSQLbooknum As String = "select distinct(booknum)from msdsmain;select distinct(suppliername) from msdsmain;select distinct(category) from msdsmain;select distinct(productname) from msdsmain;select distinct(infophone) from msdsmain;select distinct(emerphone) from msdsmain"
create adapter
Dim SQLbooknum As New SqlDataAdapter(strSQLbooknum, objconnection)
fill dataset
SQLbooknum.Fill(ds, "msdsmain")
fill comboboxes with ds.
With ComboBoxBookNum
.DataSource = ds.Tables("msdsmain")
.ValueMember = "booknum"
.DisplayMember = "booknum"
End With
With ComboBoxSupplier
.DataSource = ds.Tables("msdsmain")
.ValueMember = "suppliername"
.DisplayMember = "suppliername"
End With
With ComboBoxCategory
.DataSource = ds.Tables("msdsmain")
.ValueMember = "category"
.DisplayMember = "category"
End With
With ComboBoxproduct
.DataSource = ds.Tables("msdsmain")
.ValueMember = "productname"
.DisplayMember = "productname"
End With
With ComboBoxInfo
.DataSource = ds.Tables("msdsmain")
.ValueMember = "infophone"
.DisplayMember = "infophone"
End With
With ComboBoxEmer
.DataSource = ds.Tables("msdsmain")
.ValueMember = "emerphone"
.DisplayMember = "emerphone"
End With
First combobox fill great but when trying to fill the rest it tells me it cannot bind the new display members.
If there is a solution to this or if you have a better approach,
PLEASE feel free to to make a suggestion.
Thanks and happy Holidays to all.
Mike
Here is my scenerio,
I am trying to fil prefill multiple comboboxes.
All the data is from a single table
select distinct(booknum)from msdsmain;
select distinct(suppliername) from msdsmain;
select distinct(category) from msdsmain;
select distinct(productname) from msdsmain;
select distinct(infophone) from msdsmain;
select distinct(emerphone) from msdsmain
I need to fill 6 comboboxes with the data from each query. I tried to make all the queries into a single string:
Dim strSQLbooknum As String = "select distinct(booknum)from msdsmain;select distinct(suppliername) from msdsmain;select distinct(category) from msdsmain;select distinct(productname) from msdsmain;select distinct(infophone) from msdsmain;select distinct(emerphone) from msdsmain"
create adapter
Dim SQLbooknum As New SqlDataAdapter(strSQLbooknum, objconnection)
fill dataset
SQLbooknum.Fill(ds, "msdsmain")
fill comboboxes with ds.
With ComboBoxBookNum
.DataSource = ds.Tables("msdsmain")
.ValueMember = "booknum"
.DisplayMember = "booknum"
End With
With ComboBoxSupplier
.DataSource = ds.Tables("msdsmain")
.ValueMember = "suppliername"
.DisplayMember = "suppliername"
End With
With ComboBoxCategory
.DataSource = ds.Tables("msdsmain")
.ValueMember = "category"
.DisplayMember = "category"
End With
With ComboBoxproduct
.DataSource = ds.Tables("msdsmain")
.ValueMember = "productname"
.DisplayMember = "productname"
End With
With ComboBoxInfo
.DataSource = ds.Tables("msdsmain")
.ValueMember = "infophone"
.DisplayMember = "infophone"
End With
With ComboBoxEmer
.DataSource = ds.Tables("msdsmain")
.ValueMember = "emerphone"
.DisplayMember = "emerphone"
End With
First combobox fill great but when trying to fill the rest it tells me it cannot bind the new display members.
If there is a solution to this or if you have a better approach,
PLEASE feel free to to make a suggestion.
Thanks and happy Holidays to all.
Mike