我在表单中添加了一个 DataGridView,并使用下面的代码使其显示在 col 1 中。
Imports System.Collections.Generic
Imports System.Linq
Imports System.Data.Objects
Imports System.Data.SqlClient
Public Class editbusinesstype
Dim MyDb As New TillRoll.Group_Business_Type
Private Sub editbusinesstype_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim MyDb As New TillRollDataDataContext(MyConnStr)
Dim BusinessType = MyDb.Group_Business_Types
DataGridView1.DataSource = BusinessType
End Sub
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
End Sub
End Class
我的问题是当它加载到网格中并且我编辑一个字段时,有没有一种方法可以在关闭后将其保存到数据库中。
谢谢
本