[Resolved] Add one line of text to combo box after binding to dataset
I have the following code which binds the combo box to a dataset.
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"
At the top of this list in this combo box, I would like to add "All"
I tried this to no avail.
VB Code:
cmbStores.Items.Insert("All", 0)
I received an error about the combo box being set.
Anyone have any ideas?
Thanks!