how fix you have an error in your SQL syntax; check the manual that corresponds to your MariaDB saver version for the right syntax to use near

  Uncategorised

I am tried to insert data into a table of a sql database using the vb.net application but when I click the submit button it says " you have an error in your SQL syntax; check the manual that corresponds to your MariaDB saver version for the right syntax to use near ("…","…","…","…","…",) at line 1

here is my code

    Dim conn As New DBconnection
    Dim com As New MySqlCommand
    Dim adpt As New MySqlDataAdapter
    conn = New DBconnection()
    Dim reader As MySqlDataReader


    Try

        Dim query As String
        query = "insert into saloon.employe (empid, emp_name, emp_age, emp_salary, emp_phone, password) valuse ('" & TextBox1.Text & "', '" & TextBox2.Text & "', '" & TextBox4.Text & "', '" & TextBox3.Text & "', '" & TextBox5.Text & "', '" & TextBox6.Text & "')"
        com = New MySqlCommand(query, conn.openDB)
        reader = com.ExecuteReader

        MessageBox.Show("Data Inserted")

        conn.closeDB()


    Catch ex As Exception

        MessageBox.Show(ex.Message)

    End Try



End Sub

Source: Visual Studio Questions

LEAVE A COMMENT