早教吧作业答案频道 -->其他-->
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...的网友还看了以下:
下列各式错误的是()A.313>515B.log0.50.4>log43C.ln1π<-1D.O. 2020-04-07 …
把下面的式子变成除数是整数的除法算式75.8÷o.1=÷1;&十bsp;o.14÷o.18=÷;1 2020-04-07 …
75金币,看我问的几问,答错的答不全的,复制抄袭的不给悬赏1.点O为坐标原点,D(4,3),以OD 2020-05-17 …
A.O(n2)和O(1)B.O(nlog2n)和O(1)C.O(nlog2n)和O(n)D.O(n2 2020-05-26 …
(63)A.O(n2)和O(n)B.O(nlgn)和O(n)C.O(n2)和O(1)D.O(nlgn 2020-05-26 …
A.O(1),O(1)B.O(n),O(1)C.O(n2),O(1)D.O(n),O(n) 2020-05-26 …
H2O2(g)的生成热为133kJ•mol-1,O-H键能为463kJ•mol-1,而H2和O2的 2020-07-17 …
这是同位素吗O=C=O(1个O质量数为161个O质量数为18)O=O=O(1个O质量数为161个O 2020-07-18 …
一道简单的平均信息量计算某二元通信系统,它发送1和o的概率分别为p(1)=1/4,p(0)=3/4 2020-07-25 …
[惊人发现]1=O.9循环1=O.9循环∵1/3=O.3循环∴1/3+1/3=O.3循环+O.3循环 2020-10-31 …