Пример #1
0
        /// <summary>
        /// Execute DataTable
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        internal static DataTable ExecuteFirstDataTable(this OracleCommand command)
        {
            command.CheckNull(nameof(command));
            var ds = new DataSet();

            using var dataAdapter = new OracleDataAdapter(command);
            dataAdapter.Fill(ds);

            return(ds.Tables[0]);
        }
Пример #2
0
        /// <summary>
        /// Execute DataTable
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public static async Task <DataTable> ExecuteDataTableAsync(this OracleCommand command)
        {
            command.CheckNull(nameof(command));
            var dt = new DataTable();

            using var dataAdapter = new OracleDataAdapter(command);
            await Task.Run(() => dataAdapter.Fill(dt));

            return(dt);
        }
Пример #3
0
        /// <summary>
        /// Execute DataTable
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public static DataTable ExecuteDataTable(this OracleCommand command)
        {
            command.CheckNull(nameof(command));
            var dt = new DataTable();

            using var dataAdapter = new OracleDataAdapter(command);
            dataAdapter.Fill(dt);

            return(dt);
        }
Пример #4
0
        /// <summary>
        /// Execute DataSet
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public static DataSet ExecuteDataSet(this OracleCommand command)
        {
            command.CheckNull(nameof(command));
            var ds = new DataSet();

            using var dataAdapter = new OracleDataAdapter(command);
            dataAdapter.Fill(ds);

            return(ds);
        }
Пример #5
0
        /// <summary>
        /// Execute DataTable async
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        internal static async Task <DataTable> ExecuteFirstDataTableAsync(this OracleCommand command)
        {
            command.CheckNull(nameof(command));
            var ds = new DataSet();

            using var dataAdapter = new OracleDataAdapter(command);
            await Task.Run(() => dataAdapter.Fill(ds));

            return(ds.Tables[0]);
        }
Пример #6
0
 /// <summary>
 /// Execute DataTable
 /// </summary>
 /// <param name="command"></param>
 /// <returns></returns>
 public static Task <OracleDataReader> ExecuteReaderAsync(this OracleCommand command)
 {
     command.CheckNull(nameof(command));
     return(Task.Run(command.ExecuteReader));
 }