Esempio n. 1
0
        /// <summary>
        /// 执行单行单字段查询 参数化
        /// </summary>
        /// <param name="commandType">SQL命令类型</param>
        /// <param name="commandText">SQL语句</param>
        public static object ExecuteScalar(string sql, DataConnection con)
        {
            ProcedureDAL dal    = new ProcedureDAL(con.Connection, con.Transaction);
            object       result = dal.ExecuteScalar(sql);

            return(result);
        }
Esempio n. 2
0
 /// <summary>
 /// 执行单行单字段查询 参数化
 /// </summary>
 /// <param name="commandType">SQL命令类型</param>
 /// <param name="commandText">SQL语句</param>
 public static object ExecuteScalar(string sql)
 {
     using (DataConnection c = new DataConnection())
     {
         ProcedureDAL dal    = new ProcedureDAL(c.Connection, c.Transaction);
         object       result = dal.ExecuteScalar(sql);
         return(result);
     }
 }
Esempio n. 3
0
 /// <summary>
 /// 执行单行单字段查询
 /// </summary>
 /// <param name="commandType">SQL命令类型</param>
 /// <param name="commandText">SQL语句</param>
 public static object ExecuteScalar(string sql, List <string> parameters, List <object> parametersValues)
 {
     using (DataConnection c = new DataConnection())
     {
         ProcedureDAL dal    = new ProcedureDAL(c.Connection, c.Transaction);
         object       result = dal.ExecuteScalar(sql, parameters, parametersValues);
         return(result);
     }
 }