I have the following code which binds the combo box to a dataset.At the top of this list in this combo box, I would like to add "All"VB Code:
Dim cn As New SqlClient.SqlConnection() Dim da As SqlClient.SqlDataAdapter Dim ds As New DataSet() cn.ConnectionString = "Integrated Security=True;" & _ "Data Source=Brutus;Initial Catalog=Problem Tracking;" & _ "user id=user;password=pass;" cn.Open() da = New SqlClient.SqlDataAdapter("Select [Store Number] From Stores Order " & _ "By [Store Number]", cn) da.Fill(ds, "Stores") cmbStores.Items.Clear() cmbStores.DataSource = ds.Tables("Stores") cmbStores.DisplayMember = "Store Number"
I tried this to no avail.I received an error about the combo box being set.VB Code:
cmbStores.Items.Insert("All", 0)
Anyone have any ideas?
Thanks!




Reply With Quote