Closes or disconnects the database.
Calling Close does not issue a Commit, but some databases will automatically Commit changes in a transaction when you Close the connection and some database will automatically Rollback changes in a transaction when the connection is closed. Refer to the documentation for your database to check what its behavior is.
For desktop applications, you will often Connect to the database when the app starts and Close it when the app quits.
For web applications, you usually Connect to the database when the Session starts and Close it when the Session quits.
This code in the App.Close event handler closes a previously connected database: