title: How can i change this LINQ query to use my List<int> instead of the hard coded number?
body: <p>I finally got my LINQ to query the Datatable and with hard coded values, i get a new datatable with those records. But i need help to update this code to use my List returnClass() as my variables in the where clause.</p>
  
  <pre><code>var query = from r in d.AsEnumerable()
              where r.Field&lt;string&gt;("Column7") == "672"
              select r;
  
  DataTable output = query.CopyToDataTable&lt;DataRow&gt;();
  foreach (DataRow row in output.Rows)
  {
      output.ImportRow(row);
  }
  </code></pre>
  
  <p>Id like to replace the == "672" with the list i have that contains 94 values, that i want to exclude from the datatable.
  This is my original post that got me to where i am now, but now i just need help with the LINQ query to use my List and write in a fashion that excludes any records that have the values in my list. Im trying to filter my 34k records down to 29k using that list.</p>
  
  <p>Another example of something i tried that doesnt work</p>
  
  <pre><code>            var query = from r in d.AsEnumerable()
                      where !r.Field&lt;string&gt;("Column7").Contains(Convert.ToString(returnClass()))
                      select r;
  
          DataTable output = query.CopyToDataTable&lt;DataRow&gt;();
          foreach (DataRow row in output.Rows)
          {
              output.ImportRow(row);
          }
  </code></pre>
  
  <p>List looks like this(truncated for clarity)</p>
  
  <pre><code>    private List&lt;int&gt; returnClass()
      {
          List&lt;int&gt; cl = new List&lt;int&gt;();
          cl.Add(75);
          cl.Add(76);
          cl.Add(77);
          cl.Add(78);
          cl.Add(79);
          cl.Add(80);
          cl.Add(81);
          cl.Add(82);
          return cl;
      }
  </code></pre>