I\'m working with VB.net. I’m having problems while I connect my application to my database today so I wanted to add an error handling to close the form.
The problem
Technically the form is closed but not disposed, which means you can still reach the object but all controls in it are no longer reachable.
So you will have to call dispose from somewhere to get rid of it completely.