title: Can we execute multiple insert statements into MS Access DB 2016 using OLEDB without closing connection
body: <p>can we execute multiple insert statements into MS Access DB 2016 using OLEDB without closing connection/Keeping session alive? I tried moving the OleDB command instantiation, con.open()  and con.close() outside of foreach loop but it does not work. Any suggestions?</p>
  <pre><code>  foreach (var list in lsobj)
                  {
                      OleDbCommand cmd = new OleDbCommand();
                      cmd.Connection = con;
                      cmd.CommandType = CommandType.Text;
                      con.Open();
                      cmd.CommandText = &quot;INSERT INTO tbl(file_dt, name, created_dt)&quot;;
                                        &quot;VALUES (@file_dt,@name,@inserted_dt)&quot;;
  
                      cmd.Parameters.AddWithValue(&quot;@file_dt&quot;, list.file_dt.ToString());
                      cmd.Parameters.AddWithValue(&quot;@name&quot;, list.name);
                      cmd.Parameters.AddWithValue(&quot;@inserted_dt&quot;, list.inserted_dt.ToString());
                      
                      cmd.ExecuteNonQuery();
                      con.Close();
                  }
  </code></pre>