早教吧作业答案频道 -->其他-->
switch(Request.Params["action"]){case"QUERY"://输入的参数stringqueryParams=Request.Params["queryParams"];JObjectqueryObj=(JObject)JsonConvert.DeserializeObject(queryParams);//这里的JObject报错错误1类型“System.Collections.Spe
题目详情
switch (Request.Params["action"])
{
case "QUERY":
//输入的参数
string queryParams = Request.Params["queryParams"];
JObject queryObj = (JObject)JsonConvert.DeserializeObject(queryParams);//这里的JObject报错
错误 1 类型“System.Collections.Specialized.INotifyCollectionChanged”在未被引用的程序集中定义.必须添加对程序集“System.Windows,Version=2.0.5.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e”的引用.E:\Select\SelectApl\SelectApl.Web\process.aspx.cs 24 21 SelectApl.Web
var queryName = queryObj.Value("queryName");
//连接数据库
SqlConnection con = new SqlConnection("Data Source=.\\SQL;Initial Catalog=s_Student;Integrated Security=True");
con.Open();//打开
//执行查询
SqlCommand cmd = new SqlCommand("select stuId,stuName,stuSex,stuTelPhone,stuAddress from s_Student where stuName like @queryName + '%' ",con);
cmd.Parameters.Add(new SqlParameter("@queryName",queryName));
//执行读取
SqlDataReader dr = cmd.ExecuteReader();
string resultBuffer = "";
while (dr.Read())
{
resultBuffer += "{stuId:" + "\"" + dr.GetString(0) + "\",";
resultBuffer += "stuName:" + "\"" + dr.GetString(1) + "\",";
resultBuffer += "stuSex:" + "\"" + (dr.GetBoolean(2) "男" :"女") + "\",";
resultBuffer += "stuTelPhone:" + "\"" + dr.GetString(3) + "\",";
resultBuffer += "stuAddress:" + "\"" + dr.GetString(4) + "\"},";
}
resultBuffer = resultBuffer.Substring(0,resultBuffer.Length - 1);
resultBuffer = "{tbl:[" + resultBuffer + "]}";
Response.Write(resultBuffer);
break;
default:
Response.Write("{success:false,msg:\"暂不支持\"}");
break;
}
{
case "QUERY":
//输入的参数
string queryParams = Request.Params["queryParams"];
JObject queryObj = (JObject)JsonConvert.DeserializeObject(queryParams);//这里的JObject报错
错误 1 类型“System.Collections.Specialized.INotifyCollectionChanged”在未被引用的程序集中定义.必须添加对程序集“System.Windows,Version=2.0.5.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e”的引用.E:\Select\SelectApl\SelectApl.Web\process.aspx.cs 24 21 SelectApl.Web
var queryName = queryObj.Value("queryName");
//连接数据库
SqlConnection con = new SqlConnection("Data Source=.\\SQL;Initial Catalog=s_Student;Integrated Security=True");
con.Open();//打开
//执行查询
SqlCommand cmd = new SqlCommand("select stuId,stuName,stuSex,stuTelPhone,stuAddress from s_Student where stuName like @queryName + '%' ",con);
cmd.Parameters.Add(new SqlParameter("@queryName",queryName));
//执行读取
SqlDataReader dr = cmd.ExecuteReader();
string resultBuffer = "";
while (dr.Read())
{
resultBuffer += "{stuId:" + "\"" + dr.GetString(0) + "\",";
resultBuffer += "stuName:" + "\"" + dr.GetString(1) + "\",";
resultBuffer += "stuSex:" + "\"" + (dr.GetBoolean(2) "男" :"女") + "\",";
resultBuffer += "stuTelPhone:" + "\"" + dr.GetString(3) + "\",";
resultBuffer += "stuAddress:" + "\"" + dr.GetString(4) + "\"},";
}
resultBuffer = resultBuffer.Substring(0,resultBuffer.Length - 1);
resultBuffer = "{tbl:[" + resultBuffer + "]}";
Response.Write(resultBuffer);
break;
default:
Response.Write("{success:false,msg:\"暂不支持\"}");
break;
}
▼优质解答
答案和解析
乱码.或者系统错误
看了 switch(Request...的网友还看了以下:
M、R都是生活中常见的金属单质,其中R是用量最多的金属.甲、乙是化合物,其中甲是黑色晶体,可由R在 2020-06-06 …
汇编中,ModR/M里,R/M具体含义是什么?ModR/M决定操作数的过程中,这个R/M到底表示什 2020-06-08 …
请教高手给出概率解释(大三以上的进)C(m,k)*C(n-m,r-k)/C(n,r)=C(r,k) 2020-06-11 …
已知集合A={x|x²-2x-3≤0,x∈R},B{x|x²-2mx+m²-4≤0,x∈R,m∈R 2020-06-12 …
(2010•福建模拟)考察等式:C0mCrn−m+C1mCr−1n−m+…+CrmC0n−m=Cr 2020-07-09 …
考察等式:C0mCrn-m+C1mCr-1n-m+…+CrmC0n-m=Crn(*),其中n、m、 2020-07-09 …
有关万有引力太阳对某一行星的引力为F,该行星对太阳的引力为F1,则F=F1,F=4πˆ2k*m/r 2020-07-09 …
已知α,β,r是三个平面,m,n,l是三条直线,则能得出m⊥β的一个条件是Aα⊥β,α∩β=l,m 2020-07-13 …
一道函数题二次函数f(x)=px^2+qx+r中,实数p,q,r满足p/(m+2)+q/(m+1) 2020-07-26 …
名义利率与实际利率实际利率=名义利率-通货膨胀率和i=(1+r/m)m-1式中:i为实际利率,r为名 2020-11-15 …