Print Page | Close Window

Cascading Delete

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=3587
Printed Date: 25-Mar-2025 at 4:04am


Topic: Cascading Delete
Posted By: sven4tmn
Subject: Cascading Delete
Date Posted: 17-Aug-2012 at 2:37am
Hi,

I created cascading deletions on SqlServer, updated my entity model and ran custom tool. Now, if I delete a entity the child record's foreign key changes to empty guid and switches state to modified. Saving changes tries now to save modified child entity and retrieves error from DB (foreign key violation). Deleting entity directly on SqlServer works fine and cascades deletion.

Do I need further settings or what am I doing wrong?

Thank you
Sven

DevForce: 6.1.8
Cocktail: 1.0




Replies:
Posted By: sbelini
Date Posted: 20-Aug-2012 at 1:17pm
Sven,
 
I could not reproduce the issue here.
I am attaching a sample solution where I took the same steps as you did: updated the database for cascade delete the orders related to a customer (I updated the FK_Order_Customer Delete Rule to Cascade), updated the model from database, and ran the sample. (Note I attached a "modified version of NorthwindIB, so you wouldn't run into other constraints while trying to delete)
uploads/892/T12077.zip - uploads/892/T12077.zip
 
Regards,
   Silvio. 
 
 



Print Page | Close Window