Hello, I have a combobox that I populate with the code below. I want to have the combobox display "Please Select a Life Issue" rather than the first row in the dataset as it does now. In asp I can do this with:
cboLifeissuesTitle.Items.Insert(0, "Select a Topic")
But as you may know that is not working on my winform. How can I accomplish this task.
Here is the code I use to populate the combobox:
Dim theSQL As String
Dim DA As OleDb.OleDbDataAdapter
Dim dsTitle As DataSet
theSQL = "SELECT DISTINCT ltrim(Title) as Title from LifeIssues"
DA = New OleDb.OleDbDataAdapter(theSQL, CN)
dsTitle = New DataSet
DA.Fill(dsTitle)
cboLifeissuesTitle.DataSource = dsTitle.Tables(0).DefaultView
cboLifeissuesTitle.DisplayMember = dsTitle.Tables(0).Columns("Title").ToString
cboLifeissuesTitle.Items.Insert(0, "Select a Topic")
But as you may know that is not working on my winform. How can I accomplish this task.
Here is the code I use to populate the combobox:
Dim theSQL As String
Dim DA As OleDb.OleDbDataAdapter
Dim dsTitle As DataSet
theSQL = "SELECT DISTINCT ltrim(Title) as Title from LifeIssues"
DA = New OleDb.OleDbDataAdapter(theSQL, CN)
dsTitle = New DataSet
DA.Fill(dsTitle)
cboLifeissuesTitle.DataSource = dsTitle.Tables(0).DefaultView
cboLifeissuesTitle.DisplayMember = dsTitle.Tables(0).Columns("Title").ToString