title: Accessing Entity Framework table column by index
body: <p>I am trying to 'automate' the processing of some data from a spreadsheet into a data table using C# and the Entity Framework and it would be very efficient to be able to iterate over the fields in the spreadsheet and add the data to the fields in the table record using a couple of 'for' loops. I can create a new database record using the syntax </p>
  
  <pre><code>CompanyData newRow = new CompanyData();
  </code></pre>
  
  <p>The problem is that I cannot access the columns in the table using an index eg. </p>
  
  <pre><code>newRow[a] = worksheet.Cells[a, b]?  
  </code></pre>