-1
Try
MysqlConn.Open()
Dim Query As String
Query = " INSERT INTO billing (BillingId, PatientId, bTotal, Cashtendered, Change, bStatus, Date, bTime) VALUES ('" & billingid.Text & "' , '" & Label5.Text & "' , '" & Label13.Text & "' , '" & ctt.Text & "' , '" & changelb.Text & "' , '" & Label16.Text & "' , '" & lbdate.Text & "' , '" & lbtime.Text & "') "
COMMAND = New MySqlCommand(Query, MysqlConn)
READER = COMMAND.ExecuteReader
MessageBox.Show("Patient Saved")
MysqlConn.Close()
Catch ex As MySqlException
MessageBox.Show(ex.Message)
Finally
MysqlConn.Dispose()
End Try
你在你的sql語法中有一個錯誤檢查與你的mysql服務器版本對應的手冊,以便在'Change,bStatus,Date,bTime'附近使用正確的語法VALUES('1','1',' 500' , '987', '487', '位於第1行mysql語法錯誤;
您的代碼容易受到SQL注入攻擊 –
https://xkcd.com/327/ –
首先,您應該不要在引號整數類型,例如''「&billingid.Text&」''(刪除單個外部引號)。其次:對於上帝的愛,離開鍵盤和谷歌關於SQL注入。你正在你的網站上面放一個霓虹燈,說,請破解我 –