【发布时间】:2019-10-16 09:11:58
【问题描述】:
我无法弄清楚代码有什么问题 enter image description here
System.Data.SQLite.SQLiteException: 'SQL 逻辑错误 “进入”附近:语法错误'
private void BtnUpdate_Click(object sender, EventArgs e)
{
string StudentIDq = "update into Student (StudentID, ExamBoard, Firstname, Surname, Pure, Statistics, Mechanics, Total, " + "Average, Rank) values ('" + txtStudentID.Text + ", " + cmbExamBoard + ", " + txtFirstname.Text + "," + "" + txtSurname.Text + "," + txtPure.Text + ", " + txtStats.Text + "," + txtMechanics.Text + " + " + txtTS.Text + "," + txtAvrg.Text + "," + txtRank.Text + ")";
ExecuteQuery(StudentIDq);
LoadData();
}
【问题讨论】:
-
只需将
update into替换为insert into。 -
还阅读了sql注入。