Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HookParentRetrieved() on child firing on NewEntity()
Message
De
10/09/2008 15:19:59
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
HookParentRetrieved() on child firing on NewEntity()
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01346450
Message ID:
01346450
Vues:
44
Hi all,

With a parent/child relationship, when the parent NewEntity() is called it is calling the SetCurrentDataSet() which raises the Retrieved event. the child's HookParentRetrieved() is called with a null primary key because NewEntity doesn't have a PrimaryKey yet. As a temporary fix, I check for the PrimaryKeyValue and PrimaryKeyVaues being null in the Hook method so that it doesn't fire.

My question is, shouldn't the NewEntity() pass a false to the raiseEvents parameter in SetCurrentDataSet()? Currently it uses the overload that doesn't accept the raiseEvents parameter and the overload defaults that parameter to true.

But what do I know, I'm just a rookie at all this. :)

Thanks,
Répondre
Fil
Voir

Click here to load this message in the networking platform