title: DataColumnCollection does not contain a definition for Cast
body: <p>Why isn't this cast working?  <code>table.Columns.Cast&lt;DataColumn&gt;()</code></p>
  
  <pre><code>using (SqlBulkCopy bcp = new SqlBulkCopy(conn))
  {
      if (conn.State != ConnectionState.Open)
          conn.Open();
  
      bcp.DestinationTableName = destinationTable;
  
      //map the columns in the datatable to the sql table
      table.Columns.Cast&lt;DataColumn&gt;().ToList().ForEach(c =&gt; bcp.ColumnMappings.Add(c.ColumnName, c.ColumnName));
  }
  </code></pre>
  
  <p>I thought I was going crazy, so I tried a test table... Same thing...</p>
  
  <p><img src="https://i.stack.imgur.com/7eMYn.png" alt="enter image description here"></p>
  
  <p>This is the error:</p>
  
  <blockquote>
    <p><strong>Error   1   'System.Data.DataColumnCollection' does not contain a definition for 'Cast' and the best extension method overload
    'System.Data.EnumerableRowCollectionExtensions.Cast(System.Data.EnumerableRowCollection)'
    has some invalid arguments</strong></p>
    
    <p><strong>Error   2   Instance argument: cannot convert from 'System.Data.DataColumnCollection' to
    'System.Data.EnumerableRowCollection'</strong></p>
  </blockquote>