数据更新问题,我在前台更新了数据,但在后台没有更改。。。!!!!!!!!
Caolh 2004-11-05 02:52:19 数据更新问题,我在前台更新了数据,但在后台没有更改。。。!!!!!!!!
private void btnSave_Click(object sender, System.EventArgs e)
{
try
{
// End the Current edit. if you do not do this, when the user makes a
// change and then clicks the Save button prior to stepping to another
// records, the changes will not be propagated.
this.BindingContext[dtEmployeeInfo].EndCurrentEdit();
// Update the database with the changes made to the local resident DataSet.
da.Update(this.dtEmployeeInfo);
MessageBox.Show("Database successfully updated.",
"Custom Formatting Handler Demo", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
catch(Exception exp)
{
MessageBox.Show("There was an error when attempting to update " +
"the database: " + exp.Message,
this.Text, MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}