Cannot get ID from Combobox Value to Insert into Db
I apologize for being so vague:
Here is the code that calls the DB and populates the combo box.
cmd = New OleDb.OleDbCommand("select * from Event", cn) ==> EVENT has RaceID and RaceType
Try
UnitIDReader = cmd.ExecuteReader
If UnitIDReader.HasRows Then
While UnitIDReader.Read()
race.ValueMember = UnitIDReader("RaceType")
race.Items.Add(UnitIDReader("RaceType").ToString)
End While
End If
Catch
End Try
combobox is populated with Race information RaceType (String = 50 meter backstroke)
I have attached a screenshot of the control
1. When I do the binding, the control comes up empty
2. When I do not do binding, I get the values, but Selected Value is always NULL.
Thank you. Mate
|