title: Dapper & MS Access - Read works, Write doesn't
body: <p>Let's start by getting this out of the way: I'm stuck using an MS Access DB and I can't change it.</p>
  
  <p>This works fine:</p>
  
  <pre><code>using (OleDbConnection conn = ConnectionHelper.GetConnection())
  {
    conn.Open();
    var results = conn.Query&lt;string&gt;(
      "select FirstName from Students where LastName = @lastName", 
      new { lastName= "Smith" }
    );
    conn.Close();
  }
  </code></pre>
  
  <p>This works fine:</p>
  
  <pre><code>using (OleDbConnection conn = ConnectionHelper.GetConnection())
  {
    OleDbCommand cmd = new OleDbCommand(
      "update Students set FirstName = @firstName, City = @city where LastName = @lastName", 
      conn
    );
    cmd.Parameters.AddWithValue("firstName", "John");
    cmd.Parameters.AddWithValue("city", "SomeCity");
    cmd.Parameters.AddWithValue("lastName", "Smith");
  
    conn.Open();
    var result = cmd.ExecuteNonQuery();
    conn.Close();
  }
  </code></pre>
  
  <p>This doesn't... it executes without error but it sets the FirstName as "SomeCity" in the DB and the City as "John":</p>
  
  <pre><code>using (OleDbConnection conn = ConnectionHelper.GetConnection())
  {
    conn.Open();
    var results = conn.Query&lt;string&gt;(
      "update Students set FirstName = @firstName, City = @city where LastName = @lastName", 
      new { firstName = "John", city = "SomeCity", lastName = "Smith" }
    );
    conn.Close();
  }
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p><strong>EDIT BELOW</strong></p>
  
  <p>Dapper works if I use DynamicParameters:</p>
  
  <pre><code>using (OleDbConnection conn = ConnectionHelper.GetConnection())
  {
    DynamicParameters parameters = new DynamicParameters();
    parameters.Add("firstName", "John");
    parameters.Add("city", "SomeCity");
    parameters.Add("lastName", "Smith");
  
    conn.Open();
    var result = conn.Query&lt;string&gt;(
      "update Students set FirstName = @firstName, City = @city where LastName = @lastName",
      parameters
    );
    conn.Close();
  }
  </code></pre>