日期:2014-05-18  浏览次数:20971 次

插入问题
windows窗体应用程序
执行插入的部分代码:
string instr = "insert into 学生考勤信息(studentID,studentname,calls,courseID,grade,age,sex,sequencenum,late,truancy,vacate,attendance,gradeofquestion,recorofquestion) values(" + textBox1.Text + "'," + textBox2.Text + "'," + textBox3.Text + "'," + textBox4.Text + "'," + textBox5.Text + "'," + textBox6.Text + "'," + textBox7.Text + "'," + textBox8.Text + "'," + textBox9.Text + "'," + textBox10.Text + "'," + textBox11.Text + "'," + textBox12.Text + "'," + textBox13.Text + "'," + textBox14.Text + "')";
显示有错误,请问是哪里的问题(不是字符类型不匹配得问题)?谢谢

------解决方案--------------------
其他都懒得看了,第一个就看到问题了

values(" + textBox1.Text + "',"
你这个textBox1.Text 怎么只有后面加了引号,前面没加引号,这不是少半个吗,你好好查查吧
------解决方案--------------------
你每个(" + textBox1.Text + "'都少了半个引号呢。是吧