Solution for error "Store update, insert, or delete statement affected an unexpected number of rows" .

When creating website via asp.net mvc3, got below blocking issue,  attached solution for it:

error:

error appear on the Edit.cshtml, error message as following:

Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. Refresh ObjectStateManager entries.

 

solution:

add: @Html.HiddenFor(model => model.CourseId, "CourseId") in the Edit.cshtml

你可能感兴趣的:(statement)