예제 #1
0
 private void LoadKeyInfo()
 {
     if (this._keyInfo != null)
     {
         this._keyInfo.Dispose();
     }
     this._keyInfo = new SQLiteKeyReader(this._command.Connection, this, this._activeStatement);
 }
예제 #2
0
        /// <summary>
        /// Closes the datareader, potentially closing the connection as well if CommandBehavior.CloseConnection was specified.
        /// </summary>
        public override void Close()
        {
            try
            {
                if (_command != null)
                {
                    try
                    {
                        try
                        {
                            // Make sure we've not been canceled
                            if (_version != 0)
                            {
                                try
                                {
                                    while (NextResult())
                                    {
                                    }
                                }
                                catch (SQLiteException)
                                {
                                }
                            }
                            _command.ClearDataReader();
                        }
                        finally
                        {
                            // If the datareader's behavior includes closing the connection, then do so here.
                            if ((_commandBehavior & CommandBehavior.CloseConnection) != 0 && _command.Connection != null)
                            {
                                _command.Connection.Close();
                            }
                        }
                    }
                    finally
                    {
                        if (_disposeCommand)
                        {
                            _command.Dispose();
                        }
                    }
                }

                _command         = null;
                _activeStatement = null;
                _fieldTypeArray  = null;
            }
            finally
            {
                if (_keyInfo != null)
                {
                    _keyInfo.Dispose();
                    _keyInfo = null;
                }
            }
        }
예제 #3
0
 public override void Close()
 {
     try
     {
         if (this._command != null)
         {
             try
             {
                 try
                 {
                     if (this._version != 0L)
                     {
                         try
                         {
                             while (this.NextResult())
                             {
                             }
                         }
                         catch
                         {
                         }
                     }
                     this._command.ClearDataReader();
                 }
                 finally
                 {
                     if (((this._commandBehavior & CommandBehavior.CloseConnection) != CommandBehavior.Default) && (this._command.Connection != null))
                     {
                         this._command.Connection.Close();
                     }
                 }
             }
             finally
             {
                 if (this._disposeCommand)
                 {
                     this._command.Dispose();
                 }
             }
         }
         this._command         = null;
         this._activeStatement = null;
         this._fieldTypeArray  = null;
     }
     finally
     {
         if (this._keyInfo != null)
         {
             this._keyInfo.Dispose();
             this._keyInfo = null;
         }
     }
 }
    /// <summary>
    /// Closes the datareader, potentially closing the connection as well if CommandBehavior.CloseConnection was specified.
    /// </summary>
    public override void Close()
    {
      try
      {
        if (_command != null)
        {
          try
          {
            try
            {
              // Make sure we've not been canceled
              if (_version != 0)
              {
                try
                {
                  while (NextResult())
                  {
                  }
                }
                catch(SQLiteException)
                {
                }
              }
              _command.ClearDataReader();
            }
            finally
            {
              // If the datareader's behavior includes closing the connection, then do so here.
              if ((_commandBehavior & CommandBehavior.CloseConnection) != 0 && _command.Connection != null)
                _command.Connection.Close();
            }
          }
          finally
          {
            if (_disposeCommand)
              _command.Dispose();
          }
        }

        _command = null;
        _activeStatement = null;
        _fieldTypeArray = null;
      }
      finally
      {
        if (_keyInfo != null)
        {
          _keyInfo.Dispose();
          _keyInfo = null;
        }
      }
    }
    private void LoadKeyInfo()
    {
      if (_keyInfo != null)
        _keyInfo.Dispose();

      _keyInfo = new SQLiteKeyReader(_command.Connection, this, _activeStatement);
    }