private void Dispose(SAConnection _conn)
        {
            if (_conn != null)
            {
                if (_conn.State == ConnectionState.Open)
                {
                    _conn.Close();
                }

                _conn.Dispose();
            }
        }
Esempio n. 2
0
 /// <summary>
 ///  Dispose the connection data and be sure to close
 /// </summary>
 public override void Dispose()
 {
     if (_connection != null)
     {
         if (_connection.State != ConnectionState.Closed)
         {
             _connection.Close();
         }
         _connection?.Dispose();
     }
     _command?.Dispose();
     _transaction?.Dispose();
 }
        public void Disconnect()
        {
            if ((_connection != null) && (_connection.State != ConnectionState.Closed))
            {
                _connection.Close();
            }

            if (_connection != null)
            {
                _connection.Dispose();
            }
            if (_transaction != null)
            {
                _transaction.Dispose();
            }

            _transaction = null;
            _connection  = null;
        }