I have a combobox which is populated by a binding source. I’m trying to get my program to do the following, when the selection is changed it carries out the following command:
dataSetInstance.tbl2.Clear();
oleDbDataAdapter1.SelectCommand.Parameters[0].Value = label2.Text;
oleDbDataAdapter1.Fill(dataSetInstance.tbl2);
As a button the above piece of code works and I get the results I’m after, but using the comboBox1_SelectionChangeCommitted method with the same code it seems I have to select the item in the combo box twice to gain the same results as the code I’ve used above in a button click.
Many thanks,
Instead of
SelectionChangeCommited, try usingSelectedIndexChnaged.Have a look at this sample on MSDN: