积极答复者
请教一下,难道webmatrix里取消这种使用方式?

问题
-
{
var db=Database.Open("site");
var data=db.Query("select * from company");
if(IsPost){
var sqlq="select * from admin where ad_name=@0 and ad_pass=@1";
var sqlp1=Request["adminuser"]r;
var sqlp2=Request["adminpass"].TrimEnd();
var logchk=db.Query(sqlq,sqlp1,sqlp2).ToList();
if(logchk!=null)
{Session["depe"]=logchk.depe; (这一句系统就提示出错了,说是不包含这个定义,但数据库里明明就有这个字段,而且也能Response.write输出)
Response.Redirect("main.cshtml");
}
}
}
}
邪恶的扑满
答案
-
你logchk是List类型,怎么会有这个属性呢?
应该用属性访问器吧,譬如:
Session["depe"]=logchk[索引,从0开始].depe;
If you think one reply solves your problem, please mark it as An Answer, if you think someone's reply helps you, please mark it as a Proposed Answer
Help by clicking:
Click here to donate your rice to the poor
Click to Donate
Click to feed Dogs & Cats- 已标记为答案 Song TianModerator 2013年3月6日 7:51
全部回复
-
你logchk是List类型,怎么会有这个属性呢?
应该用属性访问器吧,譬如:
Session["depe"]=logchk[索引,从0开始].depe;
If you think one reply solves your problem, please mark it as An Answer, if you think someone's reply helps you, please mark it as a Proposed Answer
Help by clicking:
Click here to donate your rice to the poor
Click to Donate
Click to feed Dogs & Cats- 已标记为答案 Song TianModerator 2013年3月6日 7:51
-
楼上正解,与Session无关