|
-
Mar 13th, 2013, 07:25 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Concurrency Violation
I have a SQL database with a simple table (InstTypes), the fields and contents are as shown below:
No Description
1 aa
2 bb
3 cc
I can edit the datagrid and on the save button I have the following code
Private Sub btnOK_Click(sender As System.Object, e As System.EventArgs) Handles btnOK.Click
Me.Validate()
Me.InstTypesBindingSource.EndEdit()
Me.InstTypesTableAdapter.Update(Me.MIS3_new1DataSet.InstTypes)
Me.Close()
End Sub
"No" is auto-incrementing and is read only.
If I change "bb" to "dd" and try to save I get the following error.
Concurrency violation: the UpdateCommand affected 0 of the expected 1 records.
The update command is shown below.
UPDATE [dbo].[InstTypes] SET [No]=@No, [Description]=@Description WHERE (([No]=@No) AND ([Description]=@Description))
What am I doing wrong?
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|