title: Updating MySQL record not working using parameters
body: <p>Good day, I'm having a problem updating records in MySQL. The following code is in VB.Net. Whenever I execute the code I get no errors, but the information is not saved in the table. Please tell me what I am doing wrong.</p>
  
  <pre><code>SQLstr = "UPDATE mainfinancials SET charge1=?charge1, charge2=?charge2, charge3=?charge3, charge4=?charge4, charge5=?charge5" _
              &amp; " WHERE acct='?acct';"
          Pcomm.CommandText = SQLstr
          If IsNumeric(txtCharge1.Text) Then Pcomm.Parameters.AddWithValue("?charge1", CDbl(txtCharge1.Text))
          If IsNumeric(txtCharge2.Text) Then Pcomm.Parameters.AddWithValue("?charge2", CDbl(txtCharge2.Text))
          If IsNumeric(txtCharge3.Text) Then Pcomm.Parameters.AddWithValue("?charge3", CDbl(txtCharge3.Text))
          If IsNumeric(txtCharge4.Text) Then Pcomm.Parameters.AddWithValue("?charge4", CDbl(txtCharge4.Text))
          If IsNumeric(txtCharge5.Text) Then Pcomm.Parameters.AddWithValue("?charge5", CDbl(txtCharge5.Text))
          Pcomm.Parameters.AddWithValue("?acct", txtAcct.Text)
          MsgBox(SQLstr)
          Try
              PConn.Open()
              Pcomm.ExecuteNonQuery()
              PConn.Close()
              PConn.Dispose()
          Catch ex As MySqlException
              MsgBox(ex.Message.ToString())
              PConn.Close()
          End Try
  </code></pre>
  
  <p>I have deliberately place error in the the code and it would return an error message.
  can some one help me with this.
  Thanks</p>