Hey,
To start out, i'm programming in vb.net using vs2008, using sqlserver 2005 and have a combobox binded to a column in one table of my database.
I have a form that allows you to enter data that will go into the same column that the combobox is binded to. After the information is submitted from form to database, I want the combobox to instantly be updated with the new information. Here is what I have:
'Insert data into db
LTableAdapter.InsertMFGR(txtName.Text, txtAddress.Text, txtCity.Text, txtState.Text, txtZip.Text, txtPhone.Text, txtFax.Text)
'Refresh combobox code
Me.LTableAdapter.Fill(Me.EDataSet.Labs)
frmAddFrames.cboMFGR.Refresh()
frmAddFrames.Update()
frmAddFrames.Refresh()
Me.Close()
I've had similar problems in the past with dgv's not upgrading, and i finally learned how to upgrade them (by reloading the dataset), however, as you can see I've tried this in this case and its not working, how else can I update the combobox after info insertion?
Thanks!
To start out, i'm programming in vb.net using vs2008, using sqlserver 2005 and have a combobox binded to a column in one table of my database.
I have a form that allows you to enter data that will go into the same column that the combobox is binded to. After the information is submitted from form to database, I want the combobox to instantly be updated with the new information. Here is what I have:
'Insert data into db
LTableAdapter.InsertMFGR(txtName.Text, txtAddress.Text, txtCity.Text, txtState.Text, txtZip.Text, txtPhone.Text, txtFax.Text)
'Refresh combobox code
Me.LTableAdapter.Fill(Me.EDataSet.Labs)
frmAddFrames.cboMFGR.Refresh()
frmAddFrames.Update()
frmAddFrames.Refresh()
Me.Close()
I've had similar problems in the past with dgv's not upgrading, and i finally learned how to upgrade them (by reloading the dataset), however, as you can see I've tried this in this case and its not working, how else can I update the combobox after info insertion?
Thanks!