View Single Post
  #3 (permalink)  
Old 06-19-2009, 10:14 AM
motti100 motti100 is offline
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Mar 2005
Age: 39
Posts: 19
Reputation: 64
motti100 is on a distinguished programming path ahead
Default 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
Attached Images
File Type: jpg attachment.JPG (114.7 KB, 8 views)
Reply With Quote