Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Returns a <see cref="T:System.Data.DataTable" /> that describes the column metadata
 /// of the <see cref="T:System.Data.IDataReader" />.
 /// </summary>
 /// <returns>
 /// A <see cref="T:System.Data.DataTable" /> that describes the column metadata.
 /// </returns>
 /// <exception cref="T:System.InvalidOperationException">The <see cref="T:System.Data.IDataReader" /> is closed.</exception>
 public DataTable GetSchemaTable()
 {
     return(_resultIterator.CreateSchemaTable());
 }