Closing database connection when form is crossed in wpf <p>I am opening database connection using global variable in form constructor and i close it in form Exit button .The problem i am facing is if i cross the form it doesn't close database connection .How i can close connection if form is crossed ?</p>