My Update Button is:
Private Sub cmdCustUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCustUpdate.Click
If Not Customer1.GetChanges Is Nothing Then
Try
SqlDataAdapter1.Update(Customer1)
Me.Dispose()
Catch ex As Exception
MsgBox(ex.ToString)
Stop
End Try
End If
I receive an error message: Update requires valid Insert Command when passed datarow collection with new rows.
In my sqldataadapter, I configured it for 2 data tables, customer and account. account_id is a fk in the customer table. customer was chosen as the data set. I read something about command builder and a valid insert command. An explanation and maybe a code example would be helpful here. I am a newbie to this
Private Sub cmdCustUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCustUpdate.Click
If Not Customer1.GetChanges Is Nothing Then
Try
SqlDataAdapter1.Update(Customer1)
Me.Dispose()
Catch ex As Exception
MsgBox(ex.ToString)
Stop
End Try
End If
I receive an error message: Update requires valid Insert Command when passed datarow collection with new rows.
In my sqldataadapter, I configured it for 2 data tables, customer and account. account_id is a fk in the customer table. customer was chosen as the data set. I read something about command builder and a valid insert command. An explanation and maybe a code example would be helpful here. I am a newbie to this