title: Syntax error in update statement while passing value to mdb
body: <p>Please help, getting syntax error in update statement.
  this occurs when I try to update the value in database (msaccess)</p>
  
  <pre><code>try
          {
  
              DialogResult dr = MessageBox.Show("Are you sure you want to update?", "Details Updation", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
              if (dr == DialogResult.No)
              {
                  return;
              }
              else
              {                    
                  OleDbConnection oleDbConnection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=users.mdb;Persist Security Info=False");
                  OleDbCommand update = new OleDbCommand("UPDATE users SET user = '"+textBox2.Text+"' where code = 1", oleDbConnection);
                  oleDbConnection.Open();
                  update.ExecuteNonQuery();
                  oleDbConnection.Close();
  
                  MessageBox.Show("User name updated successfully", "Update Username", MessageBoxButtons.OK, MessageBoxIcon.Information);
              }
          }
  catch (SystemException se)
  {
      MessageBox.Show(se.Message);
  }
  finally
  {
  
  }
  </code></pre>