title: Lambda expression with AND operator in lambda expression
body: <p>I get an error (</p>
  
  <blockquote>
    <p>Object reference not set to an instance of an object</p>
  </blockquote>
  
  <p>) when i try to do the database operation, i can't seem to find what's wrong, must be something from this <code>p.ADRESA.Equals(listBox1.SelectedItem.ToString()</code> because without it the code works but i need two conditions, please help</p>
  
  <pre><code> Int16 idValoare =Convert.ToInt16 (comboBoxIDValoare.SelectedItem.ToString());
  
          if (selectedTabel.Equals("CUSTOMER"))
          {
              if (selectedColoana.Equals("ADRESA"))
              {
                  CUSTOMER customer = db.CUSTOMERs.First(p =&gt; (p.CUSTOMERID == idValoare) &amp;&amp; (p.ADRESA.Equals(listBox1.SelectedItem.ToString())));
                  customer.ADRESA = textBoxValoare.Text;
                  db.SaveChanges();
              }
  }
  </code></pre>