Community Center | Not monitored
Tag not monitored by Microsoft.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi guys,
I am very thankful if anybody can explain what is happening with these few lines.
private void button3_Click(object sender, EventArgs e)
{
try
{
SqlCommandBuilder customeradaptorcommand = new SqlCommandBuilder(adaptorcustomer);
adaptorcustomer.Update(tabelcustomer);
}
catch (Exception ex)
{
MessageBox.Show("error" + ex.Message, "Save Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
above one doesnt work, but below one is good
private void button3_Click(object sender, EventArgs e)
{
try
{
SqlCommandBuilder customeradaptorcommand = new SqlCommandBuilder(adaptorcustomer);
this.managercustomer.EndCurrentEdit();
adaptorcustomer.InsertCommand = customeradaptorcommand.GetInsertCommand();
this.adaptorcustomer.Update(this.tabelcustomer);
commandcustomer.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show("error" + ex.Message, "Save Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
the part that making me confused is why i need to create another customeradaptorcommand which i didnt use it when using Update command.
Tag not monitored by Microsoft.