当我使用 datagridview 和SubmitChanges()
private void Form1_Load(object sender, EventArgs e)
{
this.book_infoDataGridView.DataSource = bookstore.book_info;
BindingSource bds=new BindingSource();
bds.DataSource = this.bookstore.book_info;
this.book_infoBindingSource = bds;
this.book_infobindingNavigator.BindingSource = bds;
}
private void save_Click(object sender, EventArgs e)
{
this.book_infoBindingSource.EndEdit();
bookstore.SubmitChanges();
}