Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to delete child records when the parent is deleted?
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01154522
Message ID:
01154958
Views:
7
This message has been marked as a message which has helped to the initial question of the thread.
Liew,

>Hi all, I wish to delete all the child records whenever the parent record is deleted, what's the simplest way to do so? Thanks.

All you have to do is set the child business object's AutoDeleteOnParentDeleted property to true (you can do this in the child object's constructor).

This causes the child to receive a DeleteAll() message when the parent record is deleted. You can see the code that handles this Deleting event by examining mmBusinessObject.StateChangeHandler().

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform