Exemple #1
0
        public int process(SqlBoxQuery query, ArrayList results)
        {
            int count = -1;

            if (!query.IsEmpty())
            {
                this.m_lastQuery = query.ToString();
                if (this.DbConnection == null)
                {
                    return(count);
                }
                try
                {
                    OleDbCommand command = this.DbConnection.CreateCommand();
                    command.CommandText = query.ToString();
                    OleDbDataReader resultSet = command.ExecuteReader();
                    this.CollectResultsInList(results, resultSet);
                    count = results.Count;
                    resultSet.Close();
                }
                catch (Exception exception)
                {
                    this.error.message = "An error occurred while processing a query.";
                    this.error.info    = exception.ToString();
                }
            }
            return(count);
        }
Exemple #2
0
        public int process(SqlBoxQuery query)
        {
            int num = -1;

            if (!query.IsEmpty())
            {
                this.m_lastQuery = query.ToString();
                if ((this.DbConnection == null) || (this.DbConnection.State != System.Data.ConnectionState.Open))
                {
                    return(num);
                }
                try
                {
                    OleDbCommand command = this.DbConnection.CreateCommand();
                    command.CommandText = query.ToString();
                    num = command.ExecuteNonQuery();
                }
                catch (Exception exception)
                {
                    this.error.message = "An error occurred while processing a query.";
                    this.error.info    = exception.ToString();
                }
            }
            return(num);
        }