示例#1
0
        public void VerifyOnly()
        {
            this.CheckDisposed();
            SQLiteConnection sQLiteConnection = this._cnn;
            SQLiteBase       sQLiteBase       = sQLiteConnection._sql;

            if (sQLiteConnection == null || sQLiteBase == null)
            {
                throw new SQLiteException("invalid or unusable connection");
            }
            List <SQLiteStatement> sQLiteStatements = null;
            SQLiteStatement        sQLiteStatement  = null;

            try
            {
                string          str = this._commandText;
                uint            num = (uint)(this._commandTimeout * 1000);
                SQLiteStatement sQLiteStatement1 = null;
                while (str != null && str.Length > 0)
                {
                    sQLiteStatement  = sQLiteBase.Prepare(sQLiteConnection, str, sQLiteStatement1, num, ref str);
                    sQLiteStatement1 = sQLiteStatement;
                    if (sQLiteStatement != null)
                    {
                        if (sQLiteStatements == null)
                        {
                            sQLiteStatements = new List <SQLiteStatement>();
                        }
                        sQLiteStatements.Add(sQLiteStatement);
                        sQLiteStatement = null;
                    }
                    if (str == null)
                    {
                        continue;
                    }
                    str = str.Trim();
                }
            }
            finally
            {
                if (sQLiteStatement != null)
                {
                    sQLiteStatement.Dispose();
                    sQLiteStatement = null;
                }
                if (sQLiteStatements != null)
                {
                    foreach (SQLiteStatement sQLiteStatement2 in sQLiteStatements)
                    {
                        if (sQLiteStatement2 == null)
                        {
                            continue;
                        }
                        sQLiteStatement2.Dispose();
                    }
                    sQLiteStatements.Clear();
                    sQLiteStatements = null;
                }
            }
        }
示例#2
0
        internal SQLiteStatement BuildNextCommand()
        {
            SQLiteStatement sQLiteStatement;
            SQLiteStatement item;
            SQLiteStatement sQLiteStatement1 = null;

            try
            {
                if (this._cnn != null && this._cnn._sql != null)
                {
                    if (this._statementList == null)
                    {
                        this._remainingText = this._commandText;
                    }
                    SQLiteBase       sQLiteBase       = this._cnn._sql;
                    SQLiteConnection sQLiteConnection = this._cnn;
                    string           str = this._remainingText;
                    if (this._statementList == null)
                    {
                        item = null;
                    }
                    else
                    {
                        item = this._statementList[this._statementList.Count - 1];
                    }
                    sQLiteStatement1 = sQLiteBase.Prepare(sQLiteConnection, str, item, (uint)(this._commandTimeout * 1000), ref this._remainingText);
                    if (sQLiteStatement1 != null)
                    {
                        sQLiteStatement1._command = this;
                        if (this._statementList == null)
                        {
                            this._statementList = new List <SQLiteStatement>();
                        }
                        this._statementList.Add(sQLiteStatement1);
                        this._parameterCollection.MapParameters(sQLiteStatement1);
                        sQLiteStatement1.BindParameters();
                    }
                }
                sQLiteStatement = sQLiteStatement1;
            }
            catch (Exception exception)
            {
                if (sQLiteStatement1 != null)
                {
                    if (this._statementList != null && this._statementList.Contains(sQLiteStatement1))
                    {
                        this._statementList.Remove(sQLiteStatement1);
                    }
                    sQLiteStatement1.Dispose();
                }
                this._remainingText = null;
                throw;
            }
            return(sQLiteStatement);
        }