コード例 #1
0
 public static SqlDataReader ExecuteReader(string connectionString, string commandText, params object[] paramValues)
 {
     // get parameters and assign values
     SqlParameter[] procParams = BaseSqlHelper.GetParams(connectionString, commandText);
     BaseSqlHelper.AssignParams(procParams, paramValues);
     return(BaseSqlHelper.ExecuteReader(connectionString, commandText, procParams));
 }
コード例 #2
0
 public static string ExecuteForXml(string connectionString, string commandText, params object[] paramValues)
 {
     // get parameters and assign values
     SqlParameter[] procParams = BaseSqlHelper.GetParams(connectionString, commandText);
     BaseSqlHelper.AssignParams(procParams, paramValues);
     // defer execution to overloaded method w/ parameter array
     return(BaseSqlHelper.ExecuteForXml(connectionString, commandText, procParams));
 }
コード例 #3
0
        public static void ExecuteNonQuery(string connectionString, string commandText, params object[] paramValues)
        {
            // get parameters and assign values
            SqlParameter[] procParams = BaseSqlHelper.GetParams(connectionString, commandText);
            BaseSqlHelper.AssignParams(procParams, paramValues);
            // propagate execution to overloaded method w/ parameter array
            BaseSqlHelper.ExecuteNonQuery(connectionString, commandText, procParams);

            return;
        }