views:

904

answers:

2

Hello,

I have a combobox bound to a database table. When the user inserts a new piece of data into the table, I want the combobox to be automatically updated to display this data, however I am unsure of how I would go about doing this.

Help would be greatly appreciated.

A: 

i think, in the moment you know you add some data to this table, you should call:

yourcombobox.Databind();

also you must define yourcombobox.DataSource property again, before calling Databind()

DaDa
A: 

I have something similar to this in a program of mine.

Whenever my datagridview is updated, I empty the combobox and refill it.

Something along the lines of (I don't have my code available right now, but this is the general idea):

if (!combobox.isempty())
{
    combobox.clear()
}

// Fill combobox here
Jared Harley