Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid - Delete/Change

Status
Not open for further replies.

michu

MIS
May 1, 2002
11
US
When I change data in a column and click the update button
I get the following error:

An unhandled exception of type 'System.Data.DBConcurrencyException' occurred in system.data.dll
Additional information: Concurrency violation: the UpdateCommand affected 0 records.

When I click on a row to delete it and click the update button. I get the following
("North American Leads have been updated!")


Here is the code


Private Sub NorthAmerChgDele_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
DataSet11.Clear()
SqlDataAdapter1.Fill(DataSet11.LEADS)
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SqlDataAdapter1.Update(DataSet11.LEADS)
MessageBox.Show("North American Leads have been updated!")
Close()
End Sub
End Class



I have read that when using .Update the message "concurrency violation" can be misleading.

I'm running this on an SQL Client

What am I missing
 
I have an answer to my question. I reconfigured my DataAdapter and went to advance options and cleared the check box "Use optimistic concurrency".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top