im using a sqldataadapter, dataset and bindingsource to connect to a table. i retrieve all records from the database and i change the data on a field then update changes to database. when i try to change back to original value i get a Concurrency violation error (concurrency violation: The updatecommand affected 0 of the expected 1). this is the code:
Code:
Try Me.Validate() Me.sqlBindingSource.EndEdit() Dim slqCmdBuilder As New SqlCommandBuilder(sqlAdapter) Me.sqlAdapter.Update(Me.sqlDs.Tables("Items")) slqCmdBuilder.Dispose() slqCmdBuilder = Nothing Me.sqlBindingSource.ResetBindings(True) Catch ex As Exception MessageBox.Show(ex.Message, "Ειδοποίηση", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try
can anyone help me plz?




Reply With Quote