title: The incoming request has too many parameters. The server supports a maximum of 2100 parameters
body: <p>I have this seemingly simple linq-to-sql query that searches some data in several columns; something like this:</p>
  <pre><code>List&lt;long&gt; TheTableIDs = list of IDs (sometimes more than 2100)
  
  var QueryOutput = (from x in TheDataContext.SomeTable
  
                     where TheTableIDs.Contains(x.ID) &amp;&amp;
                     
                     x.Col1.Contains(SomeString) || 
                     x.Col2.Contains(SomeString))
  
                     select x.ID).ToList();
  </code></pre>
  <p>The error I get is this:</p>
  <blockquote>
  <p>Additional information: The incoming request has too many parameters.
  The server supports a maximum of 2100 parameters. Reduce the number of
  parameters and resend the request.</p>
  </blockquote>
  <p>What's the best way to solve this?</p>
  <p>I've looked around and a solution I found looks like this:</p>
  <pre><code>var QueryOutput = TheDataContext.SomeTable.AsEnumerable()
  
          .Join(TheTableIDs, x =&gt; x.LeadID, ci =&gt; ci, (x, ci) =&gt; x)
  
          .Where(x =&gt; SomeString.Contains(x.Col1) == true ||
                      SomeString.Contains(x.Col2) == true)
          
          .Select(x =&gt; x.ID).ToList();
  </code></pre>
  <p>This compiles and doesn't throw any exceptions but seems to ignore the <code>Where</code> clauses with <code>SomeString.Contains</code></p>
  <p>What's the solution to make this query work?</p>