Print Page | Close Window

Store update, insert, or delete statement affected

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2288
Printed Date: 29-Jul-2026 at 6:19am


Topic: Store update, insert, or delete statement affected
Posted By: orcities
Subject: Store update, insert, or delete statement affected
Date Posted: 09-Nov-2010 at 3:50pm
I am getting the following error when I save changes to one specfic entity type: Each entity creates an auditvalue entity. But when one specific entity type does it throws the error:
 
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.



Replies:
Posted By: mikewishart
Date Posted: 10-Nov-2010 at 7:21am
I had this as well.  It turned out I was trying to modify the primary key of an entity which you can't do.  You have to delete and re-add the entity with the new key.


Posted By: orcities
Date Posted: 10-Nov-2010 at 7:23am
Thank you that actually helps. The audit entity that is created creates a key based on the key structure of the entity being audited. And that would change in this case only. I will look into that.



Print Page | Close Window