mysql - 这是通过 CellEndEdit 在 datagridview 中更新数据库的唯一方法吗?

标签 mysql vb.net winforms visual-studio-2010 datagridview

在使用 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/

相关文章:

sql-server - 来自 LINQ-to-SQL 的无效对象名称

c# - SQL 更新 - 不更新 for 循环中的多行

mysql - "Random"SQL 错误 - 常规 1030,来自存储引擎的 -1

php - 从 Android 应用程序将数据插入 MySQL

c# - C# 中的固定长度字符串或结构

vb.net - 在 vb.net 中引用未实例化的对象

winforms - 如何确定要包含哪个版本的 "Oracle.DataAccess.dll"

c# - Parallel.For() 和 Windows 消息循环

PHP 单循环遍历 2 个 MySQL 表

PHP : You have an error in your SQL syntax check the manual