Ejemplo n.º 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]);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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]);
        }
Ejemplo n.º 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));
 }