Private Sub DataGridView1_RowValidated(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.RowValidated
Dim lResponse As Long
If UpdatePending Then
lResponse = MessageBox.Show("Do you wish to save changes?", "Data has Changed", MessageBoxButtons.YesNo)
If lResponse = vbYes Then
Try
Dim command_builder As SqlCommandBuilder
command_builder = New SqlCommandBuilder(daHotel)
Me.daHotel.Update(dsHotel.Tables(0))
DataGridView1.Refresh()
Me.UpdatePending = False
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Else
DataGridView1.Refresh()
Me.UpdatePending = False
End If
Else
Me.UpdatePending = False
End If
End Sub
|