主题:tableadapter更新数据库问题
我在datagridview中更改了数据,提示保存成功,但重新运行后,数据仍是原来的数据,为什么呢?求大虾赐教.保存按钮的代码如下:
private void button1_Click(object sender, EventArgs e)
{
try
{
this.Validate();
this.peopleBindingSource.EndEdit();
this.peopleTableAdapter.Update(staffDataSet.people);
MessageBox.Show("update successful");
}
catch (System .Exception ee)
{
MessageBox.Show("update failed");
}
}
private void button1_Click(object sender, EventArgs e)
{
try
{
this.Validate();
this.peopleBindingSource.EndEdit();
this.peopleTableAdapter.Update(staffDataSet.people);
MessageBox.Show("update successful");
}
catch (System .Exception ee)
{
MessageBox.Show("update failed");
}
}