在VB中语法缺少运算符SQL插入

时间:2017-03-05 14:19:14

标签: vb.net

我得到了一个"语法缺失运营商" Visual Basic中的错误。

这是我的代码:

 cmd.Connection = conn
 'add data to the database

 cmd.CommandText = "INSERT INTO [STUDENT REGISTRATION REPORT]([StudentID],[FirstName],[LastName],[Course],[YearLevel],[Department],[Age],[Gender],[Cleaning],[CavityFilling],[Xray],[Flouride],[RootCanal])" & _
 "VALUES(" & studentid.Text & "','" & firstname.Text & "','" & lastname.Text & "','" & course.Text & "','" & yearlevel.Text & "','" & department.Text & "','" & _ age.Text & "','" & gender.Text & "','" & cleaning.Checked & "','" & cavityfilling.Checked & "','" & xray.Checked & "','" & flouride.Checked & "','" & _
                      rootcanal.Checked & "')"

    cmd.ExecuteNonQuery()

    'close connection

    conn.Close()

End Sub

0 个答案:

没有答案
相关问题