Exemplo n.º 1
0
        /// <summary>
        /// Disposes of the command and clears all member variables
        /// </summary>
        /// <param name="disposing">Whether or not the class is being explicitly or implicitly disposed</param>
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                // If a reader is active on this command, don't destroy the command, instead let the reader do it
                SqliteDataReader reader = null;
                if (_activeReader != null)
                {
                    try
                    {
                        reader = _activeReader.Target as SqliteDataReader;
                    }
                    catch
                    {
                    }
                }

                if (reader != null)
                {
                    reader._disposeCommand = true;
                    _activeReader          = null;
                    return;
                }

                Connection = null;
                _parameterCollection.Clear();
                _commandText = null;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Disposes of the command and clears all member variables
        /// </summary>
        /// <param name="disposing">Whether or not the class is being explicitly or implicitly disposed</param>
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            // If a reader is active on this command, don't destroy it completely
            if (_activeReader != null)
            {
                _activeReader._disposeCommand = true;
                return;
            }

            Connection = null;
            _parameterCollection.Clear();
            _commandText = null;
        }