Where do you want to pass the dataset to? Events are functions that
happen because of something, they're not called from somewhere else in
the code (well... they can be, but not in the way other functions are
called, anyway let's not get confused here).
So, it's not possible to return something from an event. If you think
about it, you're clicking on a button - so if you returned, the return
would go to the button click - there's nothing there for data to go to
except your finger on the mouse button, but why would you want a
database injected into your finger? ;)
Basically you should handle what you want to do inside of the event,
either by having the code there, or by calling a function from within
the event.
Mounilk wrote:
Hi Benny,
Thanks for your reply.
The error should read:-
Method myfrm.btnMyBtn_Click(object, System.EventArgs)' does not match
delegate 'void System.EventHandler(object, System.EventArgs)'
ShowReport() returns a DataSet. On the click event of
btnMyBtn, I want to pass on the Dataset. Is that posssible to do?