当前位置: 代码迷 >> ASP.NET >> INSERT INTO 语句的语法异常
  详细解决方案

INSERT INTO 语句的语法异常

热度:8361   发布时间:2013-02-25 00:00:00
INSERT INTO 语句的语法错误
提示INSERT   INTO   语句的语法错误
语句如下:
sql2   =   "insert   into   Student   (   Stu_ID,PassWord,Name,Sex,Department,Grade,Class   )   values   ( ' "   +   userid   +   " ', ' "   +   pwd   +   " ', ' "   +   uname   +   " ', ' "   +   sex   +   " ', ' "   +   depart   +   " ', ' "   +   grade   +   " ', ' "   +   uClass   +   " ') ";
把Class改成[Class]还是提示这样的错误~
请高手帮忙看看错在哪里~

------解决方案--------------------------------------------------------
sql2 = "insert into [Student] ( [Stu_ID],[PassWord],[Name],[Sex],[Department],[Grade],[Class] ) values ( ' " + userid + " ', ' " + pwd + " ', ' " + uname + " ', ' " + sex + " ', ' " + depart + " ', ' " + grade + " ', ' " + uClass + " ') "

这样试下
  相关解决方案
本站暂不开放注册!
内测阶段只得通过邀请码进行注册!