try
{
DataSet changedData=this.dataSet11.GetChanges();
if(changedData!=null)
{
int changedRows=this.sqlDataAdapter1.Update(changedData);
MessageBox.Show("数据库成功更新"+changedRows+"了条记录","提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
this.dataSet11.AcceptChanges();
}
else
{
MessageBox.Show("没有需要保存的记录","没有改变",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
}
catch(Exception E)
{
MessageBox.Show("更新数据库时发生了错误:"+E.Message+"","错误",MessageBoxButtons.OK,MessageBoxIcon.Information);
this.dataSet11.RejectChanges();
}