title: Linq to sql null value check in calculation
body: <p>I have function which calculates quantity .Its working fine but some due to null values in field it does not return anything . these field can be null .i want to calculate only where both fields are not null. i think i need to use foreach but i dont know the way how can i use it here . 
  Help appreciated</p>
  
  <pre><code> private double Get_Quantity() 
      {
          try
          {
              double sum = 0;
  
              sum = (double)(from s in ManagerClass.oSqlData.table
                             where s.Demand.Order.Order_ID == Order_ID 
                             where s.Demand.Order.Order_Date &gt;= ManagerClass.startDate &amp;&amp; s.Demand.Order.Order_Date &lt;= ManagerClass.EndDate
  
                             select s.ValueA - s.ValueB ).Sum();
              return sum;
          }
          catch
          {
              return 0;
          }
      }
  </code></pre>