/// <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]); }
/// <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); }
/// <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); }
/// <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); }
/// <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]); }
/// <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)); }