title: Best way to do bulk inserts using dapper.net
body: <p>I am using the following code to insert records to a table in SQL Server 2014</p>
  
  <pre><code>using (SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["myConnString"]))
  {
  
     conn.Execute("INSERT statement here", insertList);
  
  }
  </code></pre>
  
  <p>The <code>insertList</code> is a list that has 1 million items in it. I tested this insert on a i5 desktop and it took about 65 minutes to insert a million records to SQL Server on the same machine. I am not sure how dapper is doing the inserts behind the scenes. I certainly dont want to open and close the database connection a million times! </p>
  
  <p>Is this the best way to do bulk inserts in dapper or should I try something else or go with plain ADO.Net using Enterprise library? </p>
  
  <p><strong>EDIT</strong></p>
  
  <p>In hindsight, I know using ADO.Net will be better, so will rephrase my question. I still would like to know if this is the best that dapper can do or am I missing a better way to do it in dapper itself?         </p>