回 帖 发 新 帖 刷新版面

主题:急啊~

    string sql="insert into user (userid,realname,userclass,sex,psw,question,answer,email,face,birthyear,birthmonth,birthday,userphoto,oicq,homepage,telephone,mobile,hometel,address,sign,ip,setinfo) values('"+username1+"' , '"+realname1+"','"+userclass1+"','"+sex1+"','"+psw1+"','"+question1+"','"+answer1+"','"+email1+"','"+bbspic1+"','"+birthyear1+"','"+birthmonth1+"','"+birthday1+"','"+userphoto1+"','"+oicq1+"','"+homepage1+"','"+telephone1+"','"+mobile1+"','"+hometel1+"','"+address1+"','"+sign1+"','"+ip+"','"+setinfo1+"')";
    OleDbCommand mycommand=new OleDbCommand(sql,myConnection);
     mycommand.ExecuteNonQuery();
     myConnection.Close();
错误类型:System.Data.OleDb.OleDbException: INSERT INTO 语句的语法错误。
这个错误检查了好几次,但还是没检查出来,请各位帮忙看看?谢谢啦!

回复列表 (共1个回复)

沙发

string sql="insert into [user] (userid,realname,userclass,sex,psw,question,answer,email,face,birthyear,birthmonth,birthday,userphoto,oicq,homepage,telephone,mobile,hometel,address,sign,ip,setinfo) values('"+username1+"' , '"+realname1+"','"+userclass1+"','"+sex1+"','"+psw1+"','"+question1+"','"+answer1+"','"+email1+"','"+bbspic1+"','"+birthyear1+"','"+birthmonth1+"','"+birthday1+"','"+userphoto1+"','"+oicq1+"','"+homepage1+"','"+telephone1+"','"+mobile1+"','"+hometel1+"','"+address1+"','"+sign1+"','"+ip+"','"+setinfo1+"')";

我来回复

您尚未登录,请登录后再回复。点此登录或注册