title: Insert multiple rows to SQL from DataSet using LINQ
body: <p>I am trying to use LINQPad to query an MS Access table using DataSet, and wanted to insert the query result to a SQL table.</p>
  
  <p>This is how I got the data from the MS Access table:</p>
  
  <pre><code>string connectionString = ("Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=C:\\Temp\\temp.mdb;");
  OdbcConnection myconnection = new OdbcConnection(connectionString);
  OdbcDataAdapter myadapter = new OdbcDataAdapter("SELECT * FROM Name", myconnection);
  DataSet myCustomersDS = new DataSet();
  myadapter.Fill(myCustomersDS, "Name");
  </code></pre>
  
  <p>Now In LINQPad, I wanted to insert all records from the dataset myCustomersDS to a SQL table.
  I tried to query the dataset in LINQPad this way and it gives me the right result:</p>
  
  <pre><code>Connection.Open();
  var toInsert = from b in myCustomersDS.Tables["Name"].AsEnumerable()
             select b;
  toInsert.Dump();
  Connection.Close();
  </code></pre>
  
  <p>I tried various versions of these commands, but always get errors related to the type of the DataSet not matching with the table type.</p>
  
  <pre><code>Name.InsertOnSubmit(toInsert);
  SubmitChanges();
  </code></pre>
  
  <p>Thank you,
  Steven</p>