VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,778 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
In Visual studio 2022, I have created a VB forms connect with my table in SQL. I can add new record in table but not update. Here is the code
Private Sub ButtonUpdate_Click(sender As Object, e As EventArgs) Handles ButtonUpdate.Click
Try
Me.Validate()
Me.EmployeeBindingSource.EndEdit()
Me.EmployeeTableAdapter.Update(Me.HRDataSet.Employee)
MsgBox("Update successful")
Catch ex As Exception
MsgBox("Update failed")
End Try
End Sub