/// <summary> /// Dispose action /// </summary> protected virtual void Dispose(bool dispose) { if (SQLConnection.State != ConnectionState.Closed) { SQLConnection.Close(); } }
public void Dispose() { if (Connection != null && Connection.State == ConnectionState.Open) { Connection.Close(); } if (SQLConnection != null && SQLConnection.State == ConnectionState.Open) { SQLConnection.Close(); } }
public void CloseConnection() { try { if (SQLConnection != null) { SQLConnection.Close(); } } catch (Exception ex) { throw new DataAccessException("Unable to close connection with database.", ex); } }