62,046
社区成员
发帖
与我相关
我的任务
分享
//获取值的时候转换为int
int idd = int.Parse (Request.QueryString["ID"].ToString);
//拼接SQL语句的时候 去掉引号
cmd.CommandText = "select * from chanpin where 对应你表里面的ID ="+idd+";
string idd = Request.QueryString["ID"];
cmd.CommandText = "select * from chanpin where id='"+idd+"'";
//这里错误
cmd.CommandText = "select * from chanpin where idd=id";
//修改为,idd是你前面request获取的
cmd.CommandText = "select * from chanpin where 对应你表里面的ID ='"+idd+"'";