When an application and/or process has completed operations with the database, it must release resources and close the open files by disconnecting from the database engine.
Below is the code for Done():
//
// Done()
//
// This function handles the housekeeping of closing, freeing,
// disconnecting and logging out of the database
//
static void Done()
{
Console.WriteLine("DONE");
try
{
// logout
Console.WriteLine("\tLogout...");
conn.Close();
}
catch (CtreeSqlException e)
{
Handle_Exception(e);
}
catch (Exception e)
{
Handle_Exception(e);
}
}