Close a database connection (Roaming Databases)

Closing the database connection is not necessary, but it can be done when the connection is no longer needed to release resources and locks.

The following example shows how close the database from the OnApplicationQuit method.

private void OnApplicationQuit()
{
    db.Close();
    db = null;
}