View Single Post
  #4 (permalink)  
Old 06-19-2009, 10:15 AM
cjard's Avatar
cjard cjard is offline
VB.NET Forum All-Mighty
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Apr 2006
Age: 65
Posts: 6,442
Reputation: 807
cjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond reputecjard has a reputation beyond repute
Default

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)
__________________
DW1 DW2 DW3 DW4 DNU PQ
Reply With Quote