G
Guest
Hi,
If i have a design time connection object, I can click the objects
statechange event & write code in the event handler to respond to the event
being changed. No problems.
However, if I create a coded conenction object in the click event of a
button, & create an event & delegate within that same button click event:
mySQLConObj.StateChange +=new StateChangeEventHandler(methodToHandle);
& write code in the methodToHandle event, it doesn't work.
Where in code can I put the statechange event & the delegate attached to it
in code? Or must i move the connection object out of the click button method
to do this? If so, where?
Thanks for any thoughts on this.
Regards
Ant
If i have a design time connection object, I can click the objects
statechange event & write code in the event handler to respond to the event
being changed. No problems.
However, if I create a coded conenction object in the click event of a
button, & create an event & delegate within that same button click event:
mySQLConObj.StateChange +=new StateChangeEventHandler(methodToHandle);
& write code in the methodToHandle event, it doesn't work.
Where in code can I put the statechange event & the delegate attached to it
in code? Or must i move the connection object out of the click button method
to do this? If so, where?
Thanks for any thoughts on this.
Regards
Ant