On Feb 21, 10:42 am, "Agnes" <a...@dynamictech.com.hkwrote:
My aim is "when user close the form , Close all the connection "
But .... there is no such method call "closed" in the form
I just test it that "when user click the "close form" button. The
connections still exist in the SQL server
I need to draw a "close button" and close the connection
any better way to do ? thanks a lot
Why exactly do you need to keep the connection open until the user
exits?
IMO it is much better to open the connection when it's needed, and
close it immediately after you are finished with it. It depends a lot
upon the type of application, but in my experience many users tend to
start an application, do a task, and then minimize it and forget it
until they need it again. If this is true with your application then
all of these users have a open connection to your database the entire
time tying up system resources unnecessarily
Just something to consider.
Thanks,
Seth Rowe