VB DataGridView更新

时间:2013-10-17 13:31:22

标签: mysql database vb.net

我已将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

我的问题是当它加载到网格中并且我编辑一个字段有一种方法我可以在关闭后将其保存到数据库。

由于

0 个答案:

没有答案