title: Copy Row from DataTable to another with different column schemas
body: <p>I am working on optimizing some code I have been assigned from a previous employee's code base.  Beyond the fact that the code is pretty well "spaghettified" I did run into an issue where I'm not sure how to optimize properly.</p>
  
  <p>The below snippet is not an exact replication, but should detail the question fairly well.</p>
  
  <p>He is taking one <code>DataTable</code> from an Excel spreasheet and placing rows into a consistantly formatted DataTable which later updates the database.  This seems logical to me, however, the way he is copying data seems convoluted, and is a royal pain to modify, maintain or add new formats.</p>
  
  <p>Here is what I'm seeing:</p>
  
  <pre><code>private void VendorFormatOne() 
  {
      //dtSumbit is declared with it's column schema elsewhere
      for (int i = 0; i &lt; dtFromExcelFile.Rows.Count; i++)
      {
          dtSubmit.Rows.Add(i);
          dtSubmit.Rows[i]["reference_no"] = dtFromExcelFile.Rows[i]["VENDOR REF"];
          dtSubmit.Rows[i]["customer_name"] = dtFromExcelFile.Rows[i]["END USER ID"];
          //etc etc etc
      }
  }
  </code></pre>
  
  <p>To me this is completely overkill for mapping columns to a different schema, but I can't think of a way to do this more gracefully.  In the actual solution, there are about 20 of these methods, all using different formats from <code>dtFromExcelFile</code> and the column list is much longer.  The column schema of <code>dtSubmit</code> remains the same across the board.</p>
  
  <p>I am looking for a way to avoid having to manually map these columns every time the company needs to load a new file from a vendor.  Is there a way to do this more efficiently?  I'm sure I'm overlooking something here, but did not find any relevant answers on SO or elsewhere.</p>