Click here to Skip to main content
15,900,108 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey!

so I'm trying to get the thing described in the title working. I have my database called customerDB with two tables in it, customerdata and contacts. I want to populate the combobox with the values of the columns FirstName and LastName from all rows in the table customerdata. I've tried a few different solutions, yet none of them add anything to the combobox. This is what I currently have, help would be greatly appreciated

What I have tried:

using (customerDBEntities c = new customerDBEntities())
{
    comboBox1.ValueMember = "PKCustomer"; //Primary Key of the customerdata Table
    comboBox1.DisplayMember = "FirstName" + "LastName";
    comboBox1.Invalidate();
Posted
Comments
Richard MacCutchan 17-Apr-18 7:11am    
I am no expert, but I think you need to add a BindingSource to the ComboBox to get it populated.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900