title: and operator in Linq and select distinct values using linq
body: <p>I am new to .net. I have a form in which there are two comboboxes <code>cbProduct</code> and <code>cbBrandName</code> and also a label <code>lblPrice</code>. </p>
  
  <p>I am trying to implement the below code but it is showing blue scribbles to <code>&amp;&amp;</code>. 
  (Error: <em>operator '&amp;&amp;' cannot be applied to operands of type 'lambda expression' and 'lambda expression'</em>)</p>
  
  <p>I tried the below code: (<em>not working</em>)</p>
  
  <pre><code>lblPrice.Text = string.Empty;
          lblPrice.Text = doc.Descendants("items"
              ).Where((x =&gt; x.Element("productname"
                  ).Value.Equals(cbProduct.SelectedItem.ToString())) &amp;&amp; /*blue scribbles to '&amp;&amp;'*/
                  (y =&gt; y.Element("brandname").Value.Equals(cbBrandName.SelectedItem.ToString()
                  ))).Select(k =&gt; k.Element("price"
                      ).Value).ToString();
  </code></pre>
  
  <p>My other question is that i want to make the selected values of <code>cbProduct</code> as distinct. The below code takes all the values instead of distinct values:</p>
  
  <pre><code>cbProduct.Items.AddRange(doc.Descendants("items"
              ).Select(x =&gt; x.Element("productname").Value
              ).ToArray&lt;string&gt;());//adds all products           
          cbProduct.SelectedIndex = 0;
  </code></pre>
  
  <p>giving any one answer is ok</p>
  
  <p>Please assist me
  <br>Thanks in advance</p>