Solution for Store update, insert, or delete statement affected an unexpected number of rows (0)
来源:互联网 发布:软件详细设计说明书 编辑:程序博客网 时间:2024/06/07 07:37
When i create CYTestDeptTrainWebsite via MVC3, i got blocking issue: Store update, insert, or delete statement affected an unexpected number of rows (0)...
type the solution on here:
In the Album class, you've defined [Bind(Exclude = "AlbumId")] on the class, which means that the code won't try and bind the AlbumId from the form. Which is fine, except that on the edit page, you're passing in a populated Album, which is presumably being populated using binding, which is of course ignoring the Album Id, so the AlbumId of the object passed into the edit method, is always 0, which throws a misleading concurrency error, because no rows are affected, because there's no album with ID of 0.
If you remove the bind/exclude attribute, then the edit page works as expected.
- Solution for Store update, insert, or delete statement affected an unexpected number of rows (0)
- Solution for error "Store update, insert, or delete statement affected an unexpected number of rows"
- Message = "SQL insert, update or delete failed (expected affected row count: 1, actual affected row count: 0). Possible causes:
- Invalid update: invalid number of rows in section 0. The number of rows contained in an ....
- Python: Number of rows affected by cursor.execute("SELECT …)
- SQL Basic Statement(INSERT/DELETE/UPDATE/SELECT)
- 173.Which statement describes the effect on an index, when the indexed column for the rows is update
- 删除tableview的section遇到crash:The number of rows contained in an existing section after the update
- 一个奇葩错误:Invalid update: invalid number of rows in section 0
- 一个奇葩错误:Invalid update: invalid number of rows in section 0
- oracle中表insert or update or delete触发器
- Update large number of rows in a table [ID 268395.1]
- Solution for Can’t update table ‘t1′ in stored function/trigger because it is already used by statement which invoked this store
- mybatis+postgresql insert, update or delete returning *问题
- pivot_table() got an unexpected keyword argument 'rows'
- Insert Update Delete Select
- Insert , Update , Delete 触发器
- Insert,Update,Delete操作
- bootm 与 go
- Response.Write("JS Code")后页面样式丢失问题
- 中断中处理延时及一些函数的调用规则(中断调i2c驱动有感)
- ubuntu/ linux下源码安装mysql5.5
- 一次完整的Http请求过程
- Solution for Store update, insert, or delete statement affected an unexpected number of rows (0)
- ASPXGridview添加双击事件弹出POP
- Emacs IDE for Python
- linux i2c
- 有关横竖屏显示的问题
- HDOJ 1517 博弈的理解
- 【100题】第六十六~第七十题(颠倒栈、扑克牌顺子和掷骰子概率、数字数组排成最小数、求旋转数组中最小值、全排列)
- Access获取年月日
- linux开机logo 和 android开机logo 的修改