Ticket Hash: | d76b409d079fa6b3f957767dd20141e65b816665 | |||
Title: | Concurrency violation: the UpdateCommand affected 0 of the expected 1 records | |||
Status: | Closed | Type: | Incident | |
Severity: | Important | Priority: | Medium | |
Subsystem: | None | Resolution: | Unable_To_Reproduce | |
Last Modified: | 2012-02-15 05:59:06 | |||
Version Found In: | 1.0.77.0 | |||
Description: | ||||
Hello,
My application have a datagridview connect to a dataset through the command:
DgvData.DataSource = DataSet.Tables("Table")
When the datagridview recall the event CellEndEdit and the DataAdapter update the DataSet through the command :DataAdapter.Update(DataSet.GetChanges, "Table")
VB2010 return the error:
"Concurrency violation: the UpdateCommand affected 0 of the expected 1 records."
In my applicatio I use other connector to other db for example FireBird,Postgres,Oracle,SqlServer/access and for all except Sqlite work correctly with the same code.
thanks!!! mistachkin added on 2012-01-25 21:10:40 UTC: Also see ticket [343d392b51]. anonymous added on 2012-01-26 19:57:34 UTC: the example is in VB: My class is AdoIn On New AdoIn: Connection = New SQLite.SQLiteConnection Command = New SQLite.SQLiteCommand DataAdapter = New SQLite.SQLiteDataAdapter CommandBuilder = New SQLite.SQLiteCommandBuilder(DataAdapter) then i invoke : adoIn.EseguiQuery("Select * FROM Table","Table",CommandType.Text) adoIn.EseguiQuery: Public Sub EseguiQuery(ByVal SQL As String, ByVal TableName As String, ByVal Tipo As Data.CommandType) Command.CommandType = Tipo Command.CommandText = SQL Try DataSet.Tables(TableName).Clear() Catch End Try Try Command.ExecuteNonQuery() DataAdapter.SelectCommand = Command DataAdapter.Fill(DataSet, TableName) Catch ex As Exception Err = "Execute Query : " & ex.Message End Try End Sub then when i click on treeview where there are all tables: DgvData.DataSource = adoIN.DataSet.Tables("Table") then on the event "DgvData_CellEndEdit" : adoIN.DataAdapter.Update(adoIN.DataSet.GetChanges,"Table") ecc..on all other connector this code work good thanks mistachkin added on 2012-01-30 03:34:21 UTC: |