当前位置:编程学习 > C#/ASP.NET >>

违反并发性: DeleteCommand 影响了预期 1 条记录中的 0 条

   private void bindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            int intparent = 0, intchild = 0;
            txtAmount.Focus();
            bindingSource1.EndEdit();
            bindingSource2.EndEdit();
            if (ds.Tables["DaytoDayAccount"].HasErrors)
            {
                MessageBox.Show("仍然有数据行存在错误,无法接受异动。", "请注意", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            try
            {
                DataTable d = ds.Tables["Accounts"].GetChanges();
                if (ds.Tables["Accounts"].GetChanges() != null)
                {
                    intparent = daparent.Update(ds, "Accounts");
                    ds.Tables["Accounts"].AcceptChanges();
                }
                DataTable s = ds.Tables["DaytoDayAccount"].GetChanges();
                if (ds.Tables["DaytoDayAccount"].GetChanges() != null)
                {
                    intchild = dachild.Update(ds, "DaytoDayAccount");
                    ds.Tables["DaytoDayAccount"].AcceptChanges();
                }
                MessageBox.Show("已经更新了" + intparent + "笔主账," + intchild + "笔子账");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "错误提示");
                return;
            }
        }

当我保存后,删除记录再保存就出错了,请教一下是什么问题。 --------------------编程问答--------------------
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,