Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
HookParentRetrieved() on child firing on NewEntity()
Message
From
10/09/2008 15:19:59
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
HookParentRetrieved() on child firing on NewEntity()
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01346450
Message ID:
01346450
Views:
43
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,
Reply
Map
View

Click here to load this message in the networking platform