Home All Groups Group Topic Archive Search About
Author
31 Jul 2006 2:16 PM
graphicsxp
Hi,
I have a few stored procedures called from different methods in my
vb.net code and for different dataadapters, that all share the same
connection and transaction object. The rollback() method can be called
from various places.. But I'd like to execute some code each time it is
called. How can I fire an event when this method is called ?

thanks

Author
31 Jul 2006 2:30 PM
iwdu15
first you need to declare an event

Public Event RollbackHappened()


then in your Rollback() method, just say

RaiseEvent RollbackHappened()

hope that helps
--
-iwdu15
Author
7 Aug 2006 8:40 AM
graphicsxp
Hi,
Thanks for replying.
I do not have a Rollback method. The rollback method I was referring
to, is the one of my sqlTransaction object.
I can't do Addhandler myTransaction.Rollback(), AddressOf SomeFunction,
the compiler won't let me do that : Addhanler statement event operand
must be a dot-qualified expression or a simple name.

Anyone can help with that ?

thanks

iwdu15 wrote:
Show quoteHide quote
> first you need to declare an event
>
> Public Event RollbackHappened()
>
>
> then in your Rollback() method, just say
>
> RaiseEvent RollbackHappened()
>
> hope that helps
> --
> -iwdu15
Author
7 Aug 2006 7:41 PM
graphicsxp
Anyone could help with that ?

graphicsxp a écrit :

Show quoteHide quote
> Hi,
> Thanks for replying.
> I do not have a Rollback method. The rollback method I was referring
> to, is the one of my sqlTransaction object.
> I can't do Addhandler myTransaction.Rollback(), AddressOf SomeFunction,
> the compiler won't let me do that : Addhanler statement event operand
> must be a dot-qualified expression or a simple name.
>
> Anyone can help with that ?
>
> thanks
>
> iwdu15 wrote:
> > first you need to declare an event
> >
> > Public Event RollbackHappened()
> >
> >
> > then in your Rollback() method, just say
> >
> > RaiseEvent RollbackHappened()
> >
> > hope that helps
> > --
> > -iwdu15