-
Bind combobox problemo??
I have populated a combobox with the following:
daCombo.FillSchema(dsCombo, SchemaType.Source, "tblItems")
'fiLLDATASET WITH INFO FROM DATAADAPTOR
daCombo.Fill(dsCombo, "tblItems")
'empty combo box
ComboBox2.Items.Clear()
'fill combobox2
ComboBox2.DataSource = dsCombo.Tables("tblitems")
ComboBox2.DisplayMember = "itemDescription"
ComboBox2.ValueMember = "itemID" *causing probs here
When I run the code I get the following error message:
Additional information: Could not bind to the new display member
Can someone tell me why I cant Add a value member?
I need to store the "itemID" so I can search on my form.
Thanks in Advance:confused:
-
Are "itemDescription" and "itemID" fields in "tblitems"? Are there any spelling mistakes? Everything looks right at a glance.
-
They are field names and they are not misspelled.
Wierd or what>???
-
Thanks Edneeis.
I just had a look at my code.
When i changed "itemDescription" and "itemID" to "ItemDescription" and "ItemID" it worked.
I didn't realise it was case sensitive.
-
I'm glad it was something small. I didn't realize they were case sensitive either.