public void CloseConnection() { if (dbConnection != null) if (dbConnection.State != ConnectionState.Closed) dbConnection.Close(); }