예제 #1
0
 /// <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();
            }
        }
예제 #3
0
 public void CloseConnection()
 {
     try
     {
         if (SQLConnection != null)
         {
             SQLConnection.Close();
         }
     }
     catch (Exception ex)
     {
         throw new DataAccessException("Unable to close connection with database.", ex);
     }
 }