Concurrency violation: the UpdateCommand affected 0 of the expected 1 records. Visual C# 2010

前端 未结 5 1780
走了就别回头了
走了就别回头了 2021-01-14 15:46

i\'m sorry. i wouldn\'t post this if i weren\'t out of ideas. i\'ve tried everything in the forums, but to no avail.

so i have 2 tables. both are empty at the beginn

5条回答
  •  一向
    一向 (楼主)
    2021-01-14 16:33

    i have the same problem. but i am using Visual studio 2010 with C# and windows form. i solved my problem by placing "this.contactDBDataSet.AcceptChanges(); before "this.tableAdapterManager.UpdateAll(this.contactDBDataSet);". here is the sample.

    private void peopleBindingNavigatorSaveItem_Click_2(object sender, EventArgs e)
    {
        this.Validate();
        this.peopleBindingSource.EndEdit();
        this.contactDBDataSet.AcceptChanges();// added by Humayoo
        this.tableAdapterManager.UpdateAll(this.contactDBDataSet);
    
    
    }
    

提交回复
热议问题