Today's mission: to filter the overall framework and code details, debugging functions.
One. Occurs: "The store update, insert, or DELETE statement affects the number of unexpected rows (0)." Entities may be modified or deleted after they are loaded. Refreshes the Objectstatemanager item. ”
The reasons for running the wrong language are:
1. The following names are commented on the page: @Html. hiddenfor (model = model. albumID), plus, run normally.
or 2, "Bind (Exclude =" albumID ") in the album class appears to be problematic, resulting in albumid not being able to submit correctly when the Storemanager-edit chart is submitted, always" 0 ", commenting out the name and running correctly. (I don't know if there was an error when I entered the code by tutorial).
Two.
1.{"DELETE statement conflicts with REFERENCE constraint \" Fk_invoiceline_album\ ". The conflict occurs in the database \ "mvcmusicstore\", table \ "dbo." Orderdetails\ ", column ' albumID '. \ r \ n statement terminated. "}
ALTER TABLE MvcMusicStore.dbo.OrderDetails
Drop CONSTRAINT Fk_invoiceline_album
2.{"DELETE statement conflicts with REFERENCE constraint \" Fk_cart_album\ ". The conflict occurs in the database \ "mvcmusicstore\", table \ "dbo." Carts\ ", column ' albumID '. \ r \ n statement terminated. "}
ALTER TABLE MvcMusicStore.dbo.Carts
Drop CONSTRAINT Fk_cart_album
Music Store Study notes (July 10, 2015)