早教吧 育儿知识 作业答案 考试题库 百科 知识分享

这几句程序拿错了SqlConnectionConn=newSqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["fxglConnectionString"].ConnectionString);Conn.Open();SqlCommandcmd=newSqlCommand("selectPW,ROLEfromUSERwhereID="+us

题目详情
这几句程序拿错了
SqlConnection Conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["fxglConnectionString"].ConnectionString);
Conn.Open();
SqlCommand cmd = new SqlCommand("select PW,ROLE from USER where ID=" + userid,Conn);
SqlDataReader dr;
dr = cmd.ExecuteReader();这句通不过
▼优质解答
答案和解析
select里面把user改成[user]试试