Intento actualizar una tabla de mi base de datos en MySQL desde un DataGridView en mi proyecto de VB.NET pero me sale el siguiente error:
concurrency violation the updatecommand affected 0 of the expected 1 records.
El codigo que tengo es el siguiente:
Private Sub btnUpdateServices_Click(sender As Object, e As EventArgs) Handles btnUpdateServices.Click
If cbxEmployee.Text = "" Then
MsgBox("You must select a person in charge of health care giver.")
Else
InsertarHCG()
Dim MyBuilder As MySql.Data.MySqlClient.MySqlCommandBuilder
MyBuilder = New MySql.Data.MySqlClient.MySqlCommandBuilder(connect.cur_da)
dgvServicePlan.EndEdit()
Try
connect.cur_da.Update(dt)
clsLogger.logEvent("Changes in the service plan successful.")
MessageBox.Show("Service plan successfully updated.")
Catch ex As Exception
MessageBox.Show("Could not update the service plan.")
End Try
Me.Close()
End If