Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error in code - with Stored Proc
Message
De
28/07/2004 02:18:09
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, Californie, États-Unis
 
 
À
28/07/2004 00:18:05
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00928301
Message ID:
00928601
Vues:
30
Bonnie and Shawn

This is exactly what's already happening in MM, using the ImmBusinessRuleHost interface. Shawn, check out your CompanyRules constructor
//Here, hostObject contains a reference
// to the object that created it, Company
public CompanyRules(ImmBusinessRuleHost hostObject)
Check out the "Using the HostObject Property" section of the topic "Creating Custom Business Rule Objects" in the DevGuide. It has a good example of how to reference objects that create rules objects.

Sorry I didn't notice this was the issue earlier!
---J
>Shawn,
>
>You have a coupla options here, but probably the easist is to create a Constructor for CompanyRules that accepts a parameter of type Company and pass a reference to the calling Company object. Something like this:
>
>public class CompanyRules
>
>  private Company oCompany;
>
>  public CompanyRules(Company o)
>  {
>    this.oCompany = o;
>  }
>
>  // then, when you need to call the method
>  this.oCompany.getDataSet();
>}
>
>The Company class would instantiate the CompanyRules class like this:
>
>  private CompanyRules oRules = new CompanyRules(this);
>
>There are other options, like using Interfaces, but try this first and see if you can get it working.
>
>~~Bonnie
>
>
>
>>This is what is happening I think.
>>The form instantiates
>>In the form load it calls New Company()
>>In Company it creates CompanyRules()
>>In CompanyRules() I want to access a getDataSet method in Company, so I thought I would create a New Company() Object
>>
>>I think this is the problem with the recursion you are mentioning.
>>
>>Stack Overflow is Happening in Main. I load the form and it all crashes with stack overflow.
>>Working on that now.
>>
>>Thanks for the pointers and where to look.
>>
>>New Languages...this is why i have no hair left!!! :-)
>>
>>
>>-->Shawn
>>
>>
>>
>>>>Thanks Bonnie, I did add the new Company to it and now i get a stack overflow error.
>>>>the whole prgram crashes out.
>>>>
>>>>Is it a problem that company is created on the main form. and then i try to create it again?
>>>
>>>Shawn,
>>>
>>>Where are you getting the stack overflow error? Normally creating multiple instances of something will not cause this sort of problem, but then again I have no idea what your class might be doing. There might be some repetitive recursion or something going on. Have you traced it?
>>>
>>>~~Bonnie
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform