กดบัดทึกข้อมูลแล้วมันขึ้น Syntax error in INSERT INTO statement. ตรง .ExecuteNonQuery()
ช่วยด้วยครับ
Public Function ExecuteSQL(ByVal prmSQL As String) As Boolean
connectdata()
Dim Addcom As New OleDbCommand
With Addcom
.CommandType = CommandType.Text
.CommandText = prmSQL
.Connection = conn2
.ExecuteNonQuery()
End With
ExecuteSQL = True
End Function
Private Sub AddData() Handles Button1.Click
Dim sql As String
sql = "INSERT INTO PRODUCT(PROD_ID,PROD_NAME, PROD_PRICE,DEPT_ID )VALUES ("
sql += "'" & TextBox1.Text & "',"
sql += "'" & TextBox2.Text & "',"
sql += "'" & TextBox3.Text & "',"
sql += "'" & ComboBox1.Text & "',"
sql += ")"
ExecuteSQL(sql)
MessageBox.Show("การบันทึกข้อมูลเสร็จเรียบร้อย", "ยืนยัน")
End Sub
End Class