Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to delete child records when the parent is deleted?
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01154522
Message ID:
01154958
Vues:
8
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform