private void adaugaContract_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'asigurariDataSet.client' table. You can move, or remove it, as needed.
this.clientTableAdapter.Fill(this.asigurariDataSet.client);
fillBy2ToolStripButton_Click(sender, e);
}
private void fillBy2ToolStripButton_Click(object sender, EventArgs e)
{
try
{
this.clientTableAdapter.FillBy2(this.asigurariDataSet.client);
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
}

VulpesPosted Apr 15, 2013, 10:52 AM
Assuming you're also binding the DGV to this table, then you'll need to call the DataAdapter's Update method to write the changes to the DataTable back to the database.
You'll then need to clear the DataTable, refill it using the TableAdapter via the FillByToolStrip and rebind the Name column to the ComboBox.
This sounds like it may be slow procedure but I'd try it and see.
Violeta PopaPosted Apr 15, 2013, 4:51 AM
VulpesPosted Apr 14, 2013, 7:55 PM
Violeta PopaPosted Apr 14, 2013, 2:01 PM
VulpesPosted Apr 14, 2013, 1:02 PM
Violeta PopaPosted Apr 14, 2013, 12:28 PM
I have a form, form1 which contains a datagridview. I'm adding a new record in the dgv with information about a client. In form2, i have a combobox whose items are the clients name from the dgv. If i add a new client in form 1, when i go to form 2, the combobox should contain this new client, but it doesn't. It shows the new client only if i restart my application :(
VulpesPosted Apr 14, 2013, 11:50 AM
However, before you do that I'd call the DataSet's Clear method to make sure all existing data is removed.,