combo.datasource = event
displaymember = racename
valuemember = raceid
selectedvalue databinding is bound to result.raceid
remember: fill the event table
remember: do not bind the combo's text property
remember: there is NO NEED for a datarelation between result and event
remember: youre NOT supposed to be using a data reader and then adding the items to the combo; youre supposed to be filling the event datatable and the result datatable! replace all this junk:
Code:
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
With:
Code:
Me.EventTableAdapter.Fill(swimdataset1.Events)