Passing values by reference
- From: "Chad" <chaddokmanovich@xxxxxxxxxxxxxx>
- Date: Thu, 11 May 2006 16:08:23 -0400
I have a class, MyRemoteObject, of which I create a remote instance. I call a sub, CreateAccountAndUser, passing to the sub an Account object and a User Business object, both serializable. The sub takes the info in the busines object and saves the info to the database.
The CreateAccountAndUser sub utilizes two Business objects, Account and User, calling the Save method on each. When the save method is called to create a new account record, the Account.AccountId property is updated with the assigned identify column from the Account table. Same with the User table, the UserId is set after creating a new User record.
I would like to the web app on tier 1 to get the updated versions of the Account and User objects. In the declaration below, the client gets an updated Account object because it is passed as the function's return value. However, the client does not receieve an updated User object even though the User object is passed by reference across the tiers.
Why aren't ByRef params passed across tiers? How do I return this info? Create a parent object that houses the Account and User objects and pass that object back?
Public Class MyRemoteObject
Inherits System.MarshalByRefObject
...
Public Function CreateAccountAndUser(ByVal account As Account, ByRef user As User) As Account
End Class
- Follow-Ups:
- Re: Passing values by reference
- From: Mehdi
- Re: Passing values by reference
- Prev by Date: Can I get some information about the client?
- Next by Date: Re: Passing values by reference
- Previous by thread: Can I get some information about the client?
- Next by thread: Re: Passing values by reference
- Index(es):
Relevant Pages
|
Loading