请教下这里的SQL语句躲在哪里?
这是在App_Code里的一个CS数据操作文件:
但我就是没有找到"Pr_UpdateCategoryOrder"在哪?
在相关页面cs文件里也没有?
请指点,解决马上结账!
public int UpdateCategoryOrder(int categoryID,string moveFlag)
{ ///获取连接字符串
string connectionString = ConfigurationManager.ConnectionStrings["SQLCONNECTIONSTRING"].ConnectionString;
///创建连接
SqlConnection con = new SqlConnection(connectionString);
///设置被执行存储过程的名称
string cmdText = "Pr_UpdateCategoryOrder";
///创建SqlCommand
SqlCommand cmd = new SqlCommand(cmdText,con);
///设置执行方式为存储过程
cmd.CommandType = CommandType.StoredProcedure;
///创建参数并赋值
cmd.Parameters.Add("@ID",SqlDbType.Int,4);
cmd.Parameters.Add("@MoveFlag",SqlDbType.VarChar,20);
cmd.Parameters[0].Value = categoryID;
cmd.Parameters[1].Value = moveFlag;
int result = -1;
try
{ ///打开连接
con.Open();
///操作数据
result = cmd.ExecuteNonQuery();
}
catch(Exception ex)
{ ///抛出异常
throw new Exception(ex.Message,ex);
}
finally
{ ///关闭连接
con.Close();
}
return result;
}