perform insert,update,delete using type dataset in gridview

 

 

Public Class ModifyGridview
    Dim emptable As New DataSet1.empDataTable
    Dim adp As New DataSet1TableAdapters.empTableAdapter
    Private Sub ModifyGridview_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)

Handles MyBase.Load
        DataGridView1.DataSource = emptable
        adp.Fill(emptable)
    End Sub
    Private Sub DataGridView1_CellEnter

(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs)

Handles DataGridView1.CellEnter
        adp.Update(emptable)
    End Sub

    Private Sub DataGridView1_CellValueChanged

(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellValueChanged
        adp.Update(emptable)
    End Sub

    Private Sub DataGridView1_KeyPress

(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles DataGridView1.KeyPress
        adp.Update(emptable)
    End Sub
End Class


Average Rating (1)
by Karan   Pande  in VB.Net  on 3/4/2015 2:22:57 AM  


Post Your Comment
*


nice
by   bhavesh   on  3/17/2015 5:42:56 AM