0

the MySql command is being skipped and the error being execute within th Try Catch..
Please help of possible

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
2
Contributors
1
Reply
2
Views
4 Years
Discussion Span
Last Post by Reverend Jim
0

What do you mean by "the MySql command is being skipped"? Please remove the TRY/CATCH/FINALLY/END TRY statements and post the exact text of the error message that is displayed. Your MsgBox which displays only "ERROR" is useless for debugging. It would also greatly help if you were to post the resulting SQL commandUpdate text.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.