UpdateUsingStoredProcedure on a subclassed BO


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Well, it all depends on when you actually set the UpdateUsingStoredProcedure property to true. It sounds like it is a standard .NET serialization issue. For example, when you modify the actual BO itself and set this property to true, you could technically override it on the form, thus creating a serialized value in the form designer class. To prevent this from ever happening, you could do several things. The first would be to just force this value to be initialized or set in the BO class itself in code (i.e. the OnBeforeSave). This would ensure that this property is properly set prior to use.



I am unsure why your project is doing this, but I would start by looking at the BO instance on the form or where you have it dropped to see if the form designer is overriding this setting. Otherwise, you could force it as I mentioned above.
Michel Levy
Michel Levy
StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)StrataFrame User (441 reputation)
Group: StrataFrame Users
Posts: 193, Visits: 9K
Hi,

In my project, all BO come from a BO library, in which they are all set with UpdateUsingStoredProcedure as True.

When I set UpdateUsingStoredProcedure as False on a BO on a form, this setting seems to be overridden by the setting of the BO in the BO library: saving by formSave raises an error (unable to find the update SP on the database).

I need to dynamically set it to False in the overriding function Save, before calling MyBase.Save

Is it anything I don't understand on subclassing in .Net?

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search