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);
}
}


VulpesRank #55 · 29.2K reputationPosted Apr 14, 2013, 7:50 AM EDT
However, before you do that I'd call the DataSet's Clear method to make sure all existing data is removed.,
Violeta Popa132 reputationPosted Apr 14, 2013, 8:28 AM EDT
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 :(
VulpesRank #55 · 29.2K reputationPosted Apr 14, 2013, 9:02 AM EDT
Violeta Popa132 reputationPosted Apr 14, 2013, 10:01 AM EDT
VulpesRank #55 · 29.2K reputationPosted Apr 14, 2013, 3:55 PM EDT
Violeta Popa132 reputationPosted Apr 15, 2013, 12:51 AM EDT
VulpesRank #55 · 29.2K reputationPosted Apr 15, 2013, 6:52 AM EDT
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.