Beispiel #1
0
 /// <summary>
 /// 执行指定事务的命令,指定参数值,返回DataTable.
 /// </summary>
 /// <remarks>
 /// 此方法不提供访问存储过程输入参数和返回值.
 /// 示例.:
 ///  DataTable dt = ExecuteDataset(trans, "GetOrders", 24, 36);
 /// </remarks>
 /// <param name="transaction">事务</param>
 /// <param name="spName">存储过程名</param>
 /// <param name="parameterValues">分配给存储过程输入参数的对象数组</param>
 /// <returns>返回一个结果集</returns>
 public static DataTable ExecuteDataTable(SqlTransaction transaction, string spName, params object[] parameterValues)
 {
     return(DBHelperExt.ExecuteDataTable(DBHelper.ExecuteDataset(transaction, spName, parameterValues)));
 }
Beispiel #2
0
 /// <summary>
 /// 执行指定事务的命令,指定参数,返回DataTable.
 /// </summary>
 /// <remarks>
 /// 示例:
 ///  DataTable dt = ExecuteDataset(trans, CommandType.StoredProcedure, "GetOrders", new SqlParameter("@prodid", 24));
 /// </remarks>
 /// <param name="transaction">事务</param>
 /// <param name="commandType">命令类型 (存储过程,命令文本或其它)</param>
 /// <param name="commandText">存储过程名或T-SQL语句</param>
 /// <param name="commandParameters">SqlParamter参数数组</param>
 /// <returns>返回一个包含结果集的DataTable</returns>
 public static DataTable ExecuteDataTable(SqlTransaction transaction, CommandType commandType, string commandText, params SqlParameter[] commandParameters)
 {
     return(DBHelperExt.ExecuteDataTable(DBHelper.ExecuteDataset(transaction, commandType, commandText, commandParameters)));
 }