title: Why is IEnumerable.Count() capped at 200?
body: <p>Is there a limit to the rows that IEnumerable.Count() (or IQueryable.Count()) using LINQ to SQL?  For whatever reason, if my query returns more than 200 records, I only get 200 from IEnumerable.Count().  I've even tried using IEnumerable.LongCount() (even though the number of results shouldn't be high enough to need it).  I've also verified that calling COUNT on the database returns more than 200 records.</p>
  
  <p>I've checked MSDN and tried Googling it, but to no avail.  </p>
  
  <p>Am I going crazy, or is there something that I'm missing somewhere?  I suppose this isn't really a big deal (as the program is inserting the right number of records), but it'd be nice to be able to log the number of records transferred.</p>
  
  <blockquote>
    <p>Could we see some sample code?</p>
  </blockquote>
  
  <pre><code>public IEnumerable&lt;Irms_tx_modify_profile_ban&gt; ExtractNewAdmits()
      {
          var results = from a in _dc.Applications
                        select (Irms_tx_modify_profile_ban)new RMSProfile
                        {
                            //assign column names to property names
                        };
  
          //Don't know why, but Bad Things happen if you don't put the
          //OfType call here.
          IEnumerable&lt;Irms_tx_modify_profile_ban&gt; narrowed_results = results.OfType&lt;Irms_tx_modify_profile_ban&gt;();
          Program.log.InfoFormat("Read {0} records from Banner.", narrowed_results.Count());
          return narrowed_results;
        }
  </code></pre>
  
  <p>The reason for the comment about bad things happening is due to <a href="https://stackoverflow.com/questions/378895/operation-could-destabilize-the-runtime">the issues brought up in this thread</a>.  What I did just find out is that if I call Count on narrowed_results (IEnumerable), it returns the right amount.  If I call it on results (IQueryable), it returns just 200.  I'll go ahead and solve Skeet's answer (since he mentioned the difference between IQueryable and IEnumerable), but if anyone is able to explain why this is happening, I'd like to hear it.</p>