예제 #1
0
 /// <summary>
 /// 执行命令,并将结果转换为List<T>类型
 /// </summary>
 /// <param name="strSQL">执行的SQL语句</param>
 /// <param name="param">参数</param>
 /// <typeparam name="T">返回值类型</typeparam>
 /// <returns>结果集</returns>
 public static List <T> ToList <T>(string strSQL, object param)
 {
     return(DbHelper.ToList <T>(strConnect, strSQL, param));
 }
예제 #2
0
 /// <summary>
 /// 执行命令,返回第一行,第一列的值,并将结果转换为T类型
 /// </summary>
 /// <param name="strSQL">执行的SQL语句</param>
 /// <param name="param">参数</param>
 /// <typeparam name="T">返回值类型</typeparam>
 /// <returns>结果集的第一行,第一列</returns>
 public static T ExecuteScalar <T>(string strSQL, object param)
 {
     return(DbHelper.ExecuteScalar <T>(strConnect, strSQL, param));
 }
예제 #3
0
 /// <summary>
 /// 执行命令,返回第一行,并将结果转换为T类型
 /// </summary>
 /// <param name="strSQL">执行的SQL语句</param>
 /// <param name="param">参数</param>
 /// <typeparam name="T">返回值类型</typeparam>
 /// <returns>结果集的第一行</returns>
 public static T Single <T>(string strSQL, object param)
 {
     return(DbHelper.Single <T>(strConnect, strSQL, param));
 }
예제 #4
0
 /// <summary>
 /// 批量保存数据
 /// </summary>
 /// <param name="dataTable">dataTable</param>
 /// <param name="srcTable">目标表名</param>
 public static void BatchSaveData(DataTable dataTable, string srcTable)
 {
     DbHelper.BatchSaveData(strConnect, dataTable, srcTable);
 }
예제 #5
0
 /// <summary>
 /// 执行命令,并返回影响函数
 /// </summary>
 /// <param name="strSQL">执行的SQL语句</param>
 /// <param name="param">参数</param>
 /// <returns>影响行数</returns>
 public static int ExecuteNonQuery(string strSQL, object param)
 {
     return(DbHelper.ExecuteNonQuery(strConnect, strSQL, param));
 }
예제 #6
0
 /// <summary>
 /// 执行存储过程,并将结果集填充到DataSet
 /// </summary>
 /// <param name="procName">执行的存储过程名称</param>
 /// <param name="param">参数</param>
 /// <returns>数据集</returns>
 public static DataSet RunProcedureToDataSet(string procName, object param, params string[] srcTable)
 {
     return(DbHelper.RunProcedureToDataSet(strConnect, procName, param, srcTable));
 }
예제 #7
0
 /// <summary>
 /// 执行存储过程,并将结果集填充到DataTable
 /// </summary>
 /// <param name="procName">存储过程名称</param>
 /// <param name="param">参数</param>
 /// <returns>数据集</returns>
 public static DataTable RunProcedure(string procName, object param)
 {
     return(DbHelper.RunProcedure(strConnect, procName, param));
 }
예제 #8
0
 /// <summary>
 /// 执行命令,并将结果集填充到DataTable
 /// </summary>
 /// <param name="strSQL">执行的SQL语句</param>
 /// <param name="param">参数</param>
 /// <returns>数据集</returns>
 public static DataTable FillDataTable(string strSQL, object param)
 {
     return(DbHelper.FillDataTable(strConnect, strSQL, param));
 }