none
Concurrency violation: the UpdateCommand affected 0 of the expected 1 records. RRS feed

  • Question

  • Hi
    i have a db app with access database, lately when i display a form (form has a datagridView and some controls and in dataGridView_selectedIndexChaged all fields of current row display in appropriate control) and click Update, the following error has shown me :

    Concurrency violation: the UpdateCommand affected 0 of the expected 1 records.

    before this, it works correctly, but i don't know why this error has been occured.
    here is my code :

    DataTable dt = ds_aparteman1.Tables["Aparteman"];
    DataRow curRow = dt.Rows[dataGridView1.CurrentCell.RowIndex];
    
    curRow.BeginEdit();
    curRow["name"] = txt_name.Text;
    .....
    curRow.EndEdit();
                    
    oleDbDataAdapter1.Update(ds_aparteman1.Tables["Aparteman"]); // Error has been occured in this line
    ds_aparteman1.AcceptChanges();              
    ds_aparteman1.Clear();
    
    oleDbDataAdapter1.Fill(ds_aparteman1);
    can anybody help me ?
    Thanks

    this is my Signature
    Thursday, May 7, 2009 6:09 PM

Answers

All replies