Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1470
Concurrency violation: the UpdateCommand affected 0 of the expected 1 records.
posted

I have a control that Inherits Infragistics.Win.UltraWinGrid.UltraCombo

I manually bind the control to a  BindingSource

ctl.DataBindings.Add("Value", _DBBindingSource, ctl.DataSourceFieldName, True, DataSourceUpdateMode.OnValidation)

Here are the events in order:

  1. New row is inserted in database = ok
  2. Dataset is refreshed (by requerying by the unique key) = ok
  3. Edit the dataset then update = ok

      'Commit to dataset  
       _DBBindingSource.EndEdit()
       _Database.DataAdapter.Update(_DataSet, Table.TableName)
       _DataSet.AcceptChanges()
      
    _Database is a helper class that contains the DataAdapter and functions like (GetDataSet, ExecuteNonQuery).

  4. Edit the dataset again, update = Concurrency violation.

    If I take the UltraCombo out, I don't get the concurrency violation after the 2nd edit\save.

I checked the original and current values of the dataset before and after, all items match as expected.

Before Update

  Col: 6 (STATUSID)
            Original: 0
            Current: 1

After Concurrecny Error:

Col: 6 (STATUSID)
            Original: 0
            Current: 1

I have searched the database before and after the error and I don't see the concurrency issue.

 Note: The 2nd edit can be on any control (not just the UltraCombo) that causes the violation.

 Other information:

Database = Oracle, using Microsoft Oracle provider.

We recently bought and have slowly been replacing the DataGridView with the UltraGrid and the UltraCombo has been something we've been looking for since vb3 and the SSComboBox.