Avatar of Amour22015
Amour22015
 asked on

ASP, VB.net how to properly close a main (form) application

Hi and thanks,

Without going into much detail.

I have a main form and it is being closed by the little X (close) in the upper right corner.

I have noticed that when opening the program it sometimes does not open.

I am guessing that it is because the application is not being closed correctly and that it needs a close button with the recordsets being ended and also a close?  It is mentioned that the MS has a garbage collection that automatically does this?

Thanks
ASP.NETMicrosoft SQL Server 2008.NET Programming

Avatar of undefined
Last Comment
Amour22015

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
YZlat

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Amour22015

ASKER
So you are saying that closing with the X does close the application properly and you don't have to worry about the recordsets?  I guess this is one of the reasons for VB.net.  I have more experience with VBA...

Thanks
YZlat

I believe so. But you can also go to form's closing event and put the code there to dispose of the form
Johny Bravo

Hi Amour22015,

ASP, VB.net?

What about ASP here?

The situation you describe is pretty confusing. Whenever you close your program's startup form, the entire application should quit automatically, including closing all other open forms.
(You are using MDI form??)

Alternatively ou can use , Application.exit()
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Amour22015

ASKER
Thanks