Update Database From DevExpress GridControl

Posted On // Leave a Comment
After spend hours in google, finaly I got answer about how to update database when my GridControl is updated or inserted a new row. the code is really simple, but not as simple as find the right keyword to google it ;).

So here's the few code

Private Sub __UpdateMasterJasa(ByVal grid As DevExpress.XtraGrid.GridControl)

            'save the latest changes
            Dim view As ColumnView = grid.FocusedView
            If Not (view.PostEditor() And view.UpdateCurrentRow) Then Return

            'Update the database's Jasa table to which SQLDataAdapter DAMstJasa is connected

        Catch ex As Exception


        End Try

    End Sub

Enjoy ;)

0 komentar: