I'm trying to set the selected value from a combo box that is populated from my database,
i cant seem to find a way to do that.
I'm using this to populate my combo box:
Private Sub PopulateCountry()
Dim country As New Client
Dim contryList As OdbcDataReader = country.mpopulateCountry()
Dim objCountry As String
If contryList.HasRows Then
contryList.Read()
Do While contryList.Read
objCountry = contryList(0)
cbxCCountry.Items.Add(objCountry)
cbxCountry.Items.Add(objCountry)
Loop
End If
End Sub
And calling this method(PopulateCountry()) in the form load and then using this to set the value upon my button btnAddToDB:
Dim country As String
country = cbxCCountry.SelectedValue
Any suggestion guys?