Beispiel #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);
        }
Beispiel #2
0
        /// <summary>
        /// Advances the <see cref="T:System.Data.IDataReader" /> to the next record.
        /// </summary>
        /// <returns>
        /// <see langword="true" /> if there are more rows; otherwise, <see langword="false" />.
        /// </returns>
        public bool Read()
        {
            if (_schemaOnly)
            {
                return(false);
            }

            if (_resultIterator.Read())
            {
                _isBof = false;
                return(true);
            }

            return(false);
        }