在使用 datagridview 几天甚至几周之后,我开始真正地靠自己和这里的人学习,我感谢你们所有人,但同时我也开始感到困惑。我的问题是,除了这段代码之外,还有其他方法可以在 CellEndEdit
更新 MySQL 数据库
吗?
Me.Validate()
Me.OutgoingdeliveriesBindingSource.EndEdit()
Me.OutgoingdeliveriesTableAdapter.Update(Me.OutgoingDeliveriesDataSet1.outgoingdeliveries)
如有任何建议或提示,我们将不胜感激。
最佳答案
下面是我使用的一个,可以对其进行修改以在您的实例中使用。这实际上在我的使用中似乎相当有效。
Private Sub FinancialBindingNavigatorSaveItem_Click(sender As System.Object, e As System.EventArgs) Handles FinancialBindingNavigatorSaveItem.Click
FinancialDataGridView.CommitEdit(DataGridViewDataErrorContexts.CurrentCellChange)
db.SaveChanges()
End Sub
关于mysql - 这是通过 CellEndEdit 在 datagridview 中更新数据库的唯一方法吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13301409/