title: Fastest way to update more than 50.000 rows in a mdb database c#
body: <p>I searched on the net something but nothing really helped me. I want to update, with a list of article, a database, but the way that I've found is really slow.</p>
  
  <p>This is my code:</p>
  
  <pre><code>List&lt;Article&gt; costs = GetIdCosts(); //here there are 70.000 articles
  conn = new OleDbConnection(string.Format(MDB_CONNECTION_STRING, PATH, PSW));
  conn.Open();
  transaction = conn.BeginTransaction();
  
  using (var cmd = conn.CreateCommand())
  {
      cmd.Transaction = transaction;
  
      cmd.CommandText = "UPDATE TABLE_RO SET TABLE_RO.COST = ? WHERE TABLE_RO.ID = ?;";
  
      for (int i = 0; i &lt; costs.Count; i++)
      {
          double cost = costs[i].Cost;
          int id = costs[i].Id;
  
          cmd.Parameters.AddWithValue("data", cost);
          cmd.Parameters.AddWithValue("id", id);
  
          if (cmd.ExecuteNonQuery() != 1) throw new Exception();
      }
  }
  
  transaction.Commit();
  </code></pre>
  
  <p>But this way take a lot of minutes something like 10 minutes or more. There are another way to speed up this updating ? Thanks.</p>