i 反映这一错误:
Compiler Error Message: CS1001: Identifier expected
摘自这套法典:
var reqcategory="";
foreach(Request["category"] as reqcategory)
{
var sql5 = "SELECT Type.PreReq1, Type.PreReq2, (CASE WHEN (Type.PreReq1 IS NOT NULL) AND (PermitApp1.RPClass IS NULL) AND (PermitApp1.RPCategory IS NULL) THEN 1 ELSE 0 END) AS missing1, (CASE WHEN (Type.PreReq2 IS NOT NULL) AND (PermitApp2.RPClass IS NULL) AND (PermitApp2.RPCategory IS NULL) THEN 1 ELSE 0 END) AS missing2 FROM Type LEFT JOIN PermitApp AS PermitApp1 ON (Type.PreReq1=PermitApp1.RPClass) OR (Type.PreReq1=PermitApp1.RPCategory) AND ( PermitApp1.CDSID = @0 ) AND (PermitApp1.MDecision= 1 ) LEFT JOIN PermitApp AS PermitApp2 ON (Type.PreReq2=PermitApp2.RPClass) OR (Type.PreReq2=PermitApp2.RPCategory) AND ( PermitApp2.CDSID = @1 ) AND (PermitApp2.MDecision= 1 ) WHERE Type.PType = @2";
var result = db.QuerySingle(sql5, myCDSID, myCDSID, reqcategory);
var miss1 = result.missing1;
var miss2 = result.missing2;
}
The error happens to fall on this line:
foreach(Request["category"] as reqcategory)
正如汇编者所强调的那样。
谁能告诉我我的错误是什么? 如何宣布身份识别?
什么是识别? 在。
如果使用<代码>int.parse 权利,但如果它正在扼杀......怎么能够这样做?
成就 成就
BTW 我正在使用网络矩阵。
在使用JardedPar 解决办法之后......下一个错误是......
CS1026: ) expected
这一部分:
if (miss1 == 1 or miss2 == 1 ){
ModelState.AddError("missing", "You have not met the Pre-Requisites for "+ cat +" yet.")
} else if (miss1 == 0 and miss2 == 0 ){
Session["license"] = Request["licence"];
Session["from"] = Request["from"];
Session["to"] = Request["to"];
Session["group"] = Request["group"];
Session["class1"] = Request["class1"];
Session["category1"] = Request["category1"];
Session["class"] = Request["class"];
Session["category"] = Request["category"];
Response.Redirect("~/Questionnaire");
}
on this line:
if (miss1 == 1 or miss2 == 1 ){
...... 我看不出为什么需要(在那里......我已经关闭了所有这一切)。