解决问题:Concurrency violation: the UpdateCommand affected 0 of the expected 1 records(UpdateCommand 影响了预期1 条记录中的0 条 )
来源:互联网 发布:淘宝联盟买家有优惠吗 编辑:程序博客网 时间:2024/04/30 18:15
原因: 对具有自增列的表进行新增并多次保存,由于第一次保存(插入)后没有获得到自增列的值,再次保存(更新)时失败。
解决方法,在获取数据时增加FillSchema()操作:
adapter.FillSchema(ds, adapter.Fill(ds); 这样,在 adapter.Update(ds); 时就可以自动得到自增列的值;从而,不会保存失败了。 (自增列应为主键) 测试代码下载
- 解决问题:Concurrency violation: the UpdateCommand affected 0 of the expected 1 records(UpdateCommand 影响了预期1 条记录中的0 条 )
- Concurrency violation: the UpdateCommand affected 0 of the expected 1 records.
- (违反并发性: UpdateCommand 影响了预期 1 条记录中的 0 条 )的原因
- 违反并发性: UpdateCommand影响了预期 1 条记录中的 0 条
- 违反并发性: UpdateCommand影响了预期 1 条记录中的 0 条
- 违反并发性: UpdateCommand影响了预期 1 条记录中的 0 条
- 违反并发性: UpdateCommand 影响了预期1条记录中的0条
- 违反并发性: UpdateCommand影响了预期 1 条记录中的 0 条
- 关于“违反并发性: UpdateCommand影响了预期 1 条记录中的 0 条”的数据库更新错误
- 并发冲突UpdateCommand影响0个记录”的错误
- Effective Concurrency 1 The Pillars of Concurrency
- Message = "SQL insert, update or delete failed (expected affected row count: 1, actual affected row count: 0). Possible causes:
- The Complexities of Concurrency
- [学习笔记][ASP.NET2.0][Gridview][UpdateCommand的写法要点]
- [学习笔记][ASP.NET2.0]DataSource UpdateCommand Troubleshooting
- 如何找出相邻3条记录都满足同一条件(How to find out 3 continuous records all reach the same condition)
- Records: The concepts of cin.get..
- Cool, i have fixed the "Access violation writing to 0x00000008" of BlackBerry Simulator(JDE5.0)
- 该死的IE7---VC++2005创建智能设备项目失败的解决方法
- 从给定的文本中,查找其中最长的重复子字符串的问题
- LINUX下的CP命令的源代码
- .NET手持设备开发工具包安装调试篇
- Oracle10g BIGFILE表空间带来的好处
- 解决问题:Concurrency violation: the UpdateCommand affected 0 of the expected 1 records(UpdateCommand 影响了预期1 条记录中的0 条 )
- 万恶的微软之ADOCE苦旅
- ToString()对性能的影响
- 第一个DWR
- 使用dbms_stats但不生成histogram的方法
- 3D游戏实时显示帧率,截图(bmp,jpg,png),录象(wmv,avi)等功能的软件
- 一条SQL生成九九乘法表
- evc4工程移植vs.net2005所碰到的问题积累
- 暂停一个进程的运行