title: C# CopyToDataTable method not working
body: <p>I have been searching on how to fix this for many hours now and I cant seem to quite figure it out. What I am trying to do is select a portion of 1 table and copy it to a temp table (my application needs to work with specific groups at a time). When I try to implement the CopyToDataTable() method i get an error saying: </p>
  
  <blockquote>
    <p>Parameter count mismatch</p>
  </blockquote>
  
  <p>and it highlights line 137 in the ObjectSchredder.cs file (the one from microsofts website). My code is below:</p>
  
  <pre><code>private void fillTempTable()
  {
      IEnumerable&lt;DataRow&gt; tempResults = from row in sourceTable.AsEnumerable()
                                         where row.Field&lt;String&gt;("GroupID") == GetCurrentGroupName()
                                         select row;
  
      tempGroup = tempResults.CopyToDataTable&lt;DataRow&gt;(); //Everything seems to work until this line               
  }
  </code></pre>