Murray Brown
asked on
VB.net Concurrency Violation when trying to update a SQL table dynamically
Hi
I use the following code to dynamically edit a SQL table in a Windows Form DataGridView.
Most of the time things work but around one out of every 5 times I get the error shown in the image below.
Why would this be? Is there a better way to dynamically update a SQL table based on changes made by the user?
I use the following code to dynamically edit a SQL table in a Windows Form DataGridView.
Most of the time things work but around one out of every 5 times I get the error shown in the image below.
Why would this be? Is there a better way to dynamically update a SQL table based on changes made by the user?
Sub oDynamic_SQL_Save()
Try
Dim builder As New SqlCommandBuilder(dbadp2)
builder.QuotePrefix = "["
builder.QuoteSuffix = "]"
dbadp2.UpdateCommand = builder.GetUpdateCommand()
dbadp2.Update(dTable2)
dTable2.AcceptChanges()
Catch ex As Exception
MsgBox(Err.Description & " mmm")
End Try
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER