I have a combo box which displays the values of a table "city(cityid, city name)"...
city id is the value member and city name is the display member..
Now i have to add the city name in table through combobox...
This will be done by the user!!!
I'm not able to do this, if anybody could help?????
Pls.......
Adding items in a table whose contents are displayed in a combo box
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Amit ChoudharyRank #145 · 15.8K reputationPosted Mar 6, 2010, 12:41 AM EST
Create a form like this...
now create button click event and write following code inside it:
private void button1_Click(object sender, EventArgs e) { comboBox1.Items.Add(comboBox1.Text); /* you can save the value of comboBox1.Text to DataBase as well * and after saving to database you can corresponding id to the value * with the item */ } Download the attachment for the running code.Please mark as answer if it helps