Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat's causing my UPDATE statement not to work?
    primarykey
    data
    text
    <p>Good evening all,</p> <p>I'm using the following as an attempt to update records in my MySQL database, but the records aren't being updated and I'm not catching any exceptions either. Your help would be kindly appreciated:</p> <pre><code>dbConn = New MySqlConnection("Server=" &amp; FormLogin.ComboBoxServerIP.SelectedItem &amp; ";Port=3306;Uid=trojan;Password=horse;Database=accounting") Try If dbConn.State = ConnectionState.Open Then dbConn.Close() Else Try dbConn.Open() Dim dbAdapter As New MySqlDataAdapter("UPDATE customer " &amp; _ "SET accountNumber= '" &amp; TextBoxAccount.Text &amp; "', nameLAST='" &amp; TextBoxLastName.Text &amp; "', nameFIRST='" &amp; TextBoxFirstName.Text &amp; "'" &amp; _ "nameSALUTATION='" &amp; ComboBoxSalutation.SelectedItem &amp; "', nameCOMPANY='" &amp; TextBoxCompanyName.Text &amp; "', addressSTREET='" &amp; TextBoxAddress1.Text &amp; "'" &amp; _ "addressSTREET1='" &amp; TextBoxAddress2.Text &amp; "', addressCITY='" &amp; TextBoxCity.Text &amp; "', addressSTATE='" &amp; ComboBoxState.SelectedItem &amp; "'" &amp; _ "addressZIPCODE='" &amp; MaskedTextBoxZip.Text &amp; "', phone='" &amp; MaskedTextBoxPhone.Text &amp; "', fax='" &amp; MaskedTextBoxFax.Text &amp; "', email='" &amp; TextBoxEmail.Text &amp; "'" &amp; _ "WHERE accountNumber='" &amp; TextBoxAccount.Text &amp; "';", dbConn) Catch ex As Exception MessageBox.Show("A DATABASE ERROR HAS OCCURED" &amp; vbCrLf &amp; vbCrLf &amp; ex.Message &amp; vbCrLf &amp; _ vbCrLf + "Please report this to the IT/Systems Helpdesk at Ext 131.") End Try MessageBox.Show("Customer account SUCCESSFULLY updated!") Call lockForm() End If Catch ex As Exception MessageBox.Show("A DATABASE ERROR HAS OCCURED" &amp; vbCrLf &amp; vbCrLf &amp; ex.Message &amp; vbCrLf &amp; _ vbCrLf + "Please report this to the IT/Systems Helpdesk at Ext 131.") End Try Call lockForm() dbConn.Close() </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload