Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

MySql UPDATE error with VB2010... HELP

$
0
0
this is the code i am using

when the try catch is executed the error is produced.. the MySqlCommand is skipped..

PLEASE help if you can


 Dim myConnString = ";" & _
        "Database = inventory;" & _
        "Uid = root;" & _
        "Pwd = root;" & _
        "Connect Timeout = 30;"

        Dim myupdateconnection As New MySqlConnection(myConnString)

        Dim commandUpdate As New MySqlCommand("UPDATE tblcustomer SET FirstName = '" & fName.Text & "'," & _
                                              "LastName = '" & lName.Text & "'," & _
                                              "Address = '" & addr.Text & "'," & _
                                              "StateProvince = '" & state.Text & "'," & _
                                              "ZipCode = '" & zip.Text & "'," & _
                                              "Country = '" & country.Text & "'," & _
                                              "Phone = '" & cNumber.Text & "'," & _
                                              "Fax = '" & fax.Text & "', " & _
                                              "WHERE CustomerID = '" & id.Text & "' ", myupdateconnection)



        Try
            myupdateconnection.Open()
            commandUpdate.ExecuteNonQuery()

        Catch
            MessageBox.Show("Error")
        Finally
            myupdateconnection.Close()
        End Try





Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>