title: Linq to Datatable with multiple where clauses
body: <p>Situation:
  Linq query to datatable with multiple where clauses.
  The filter for the where clause comes from several ComboBoxes like account, year, month, etc.
  The result of the query will be saved into a different datatable.</p>
  
  <p>I have different queries like...</p>
  
  <pre><code>        //Filter Year
              var query = from myRow in ds.Tables["tblOriginal"].AsEnumerable()
                          where myRow.Field&lt;DateTime&gt;("Datum").Year == int.Parse(cmbFilterYear.Text)
                          select myRow;
              ds.Tables["tblFilteredData"].Merge(query.CopyToDataTable());
  </code></pre>
  
  <p>... I have about six of these Linq queries which I want to have in one single query with different where clauses using</p>
  
  <pre><code>...&amp;&amp;...
  </code></pre>
  
  <p>It works if all ComboBoxes are filled with values.</p>
  
  <p>But it won't work if e.g. only 4 of 6 ComboBoxes are filled with values.</p>
  
  <p>Is there a possibility to put an "IF..." into the "where"-block of the query?</p>
  
  <p>I have already tried to use a stringbuilder to set a variable for the where clause but I can't convert it into a proper boolean.</p>
  
  <p>Any idea is appreciated.</p>