Exemple #1
0
        /// <summary>
        /// Executes the <c>SELECT</c> query specified in <see cref="Evaluatable.Text"/>.
        /// </summary>
        /// <exception cref="CompilationException">Thrown when <see cref="Evaluatable.Text"/> could not be compiled as query.</exception>
        /// <exception cref="RuntimeException">Thrown when an error during execution occured.</exception>
        public DataTable ExecuteDataTable()
        {
            EnsureCompiled();

            DataTable dataTable = _resultIterator.CreateSchemaTable();

            _resultIterator.Initialize();
            _resultIterator.Open();
            while (_resultIterator.Read())
            {
                dataTable.Rows.Add(_resultIterator.RowBuffer);
            }

            return(dataTable);
        }
        internal QueryDataReader(ResultIterator resultIterator, bool schemaOnly)
        {
            _resultIterator = resultIterator;
            _schemaOnly     = schemaOnly;
            _isBof          = true;

            if (!schemaOnly)
            {
                _resultIterator.Initialize();
                _resultIterator.Open();
            }
        }