I am coding in VB.NET and I'm getting this error when I'm trying to insert a record into my SQL database.
Public Sub SaveNames(ByRef SQLStatement As String)
Dim cmd As MySqlCommand = New MySqlCommand
With cmd
.CommandText = SQLStatement
.CommandType = CommandType.Text
.Connection = SQLConnection
.ExecuteNonQuery()
End With
SQLConnection.Close()
MsgBox("Successfully Added")
SQLConnection.Dispose()
End Sub
Private Sub cmdSave_Click(sender As Object, e As EventArgs) Handles cmdSave.Click
Dim SQLStatement As String = "INSERT INTO people(name) VALUES (‘" & TextBox1.Text & "')"
SaveNames(SQLStatement)
End Sub