title: c# Update Command to Access Database
body: <p>I am trying to update data in access table. However, i keep receiving a syntax error when i attempt to update. Below is the code ive compiled. Textbox37 is the one that requires updates. </p>
  
  <pre><code>string constr1;
  
  constr1 = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=F:\\Documents\\data.accdb;Jet OLEDB:Database";
  
  string cmdstr = "Update Log(Notes,Status)Values(@a,@b) Where LogIncNum='" + LogInc + "'";
  
  using (OleDbConnection con1 = new OleDbConnection(constr1))
  {
      using (OleDbCommand com = new OleDbCommand(cmdstr, con1))
      {
          com.CommandType = CommandType.Text;                       
          com.Parameters.AddWithValue("@a", textBox37.Text);
          com.Parameters.AddWithValue("@b", "Active");
  
          con1.Open();
          com.ExecuteNonQuery();  
      }
  }
  </code></pre>