title: Cannot implicitly convert type 'double?' to 'double'
body: <p>i am using asp.net MVC2 and i am getting an error on the follwoing line of code</p>
  
  <pre><code>&lt;% double RunningTotal = 0; %&gt;
  &lt;%foreach (var item in Model)
         {%&gt;
        &lt;%var allowedHours = item.tblPerson.tblPersonAllowedHours.Where(x=&gt;x.Semester == item.Semester).Sum(x=&gt;x.AllowedHoursPerWeek);  %&gt;         
              &lt;tr&gt;
                  &lt;td&gt;&lt;%: item.Semester %&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;%: allowedHours.ToString() %&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;%: item.tblPerson.tblCourseWantedHours.Where(x =&gt; x.Semester == item.Semester).Sum(x =&gt; x.WantedHoursPerWeek+x.UL+x.UT) %&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;%: item.tblPerson.tblCourseWantedHours.Where(x =&gt; x.Semester == item.Semester).Sum(x =&gt; x.WantedHoursPerWeek+x.UL+x.UT) - allowedHours %&gt;&lt;/td&gt;
                  &lt;%: RunningTotal += (item.tblPerson.tblCourseWantedHours.Where(x =&gt; x.Semester == item.Semester).Sum(x =&gt; x.WantedHoursPerWeek + x.UL + x.UT) - allowedHours) %&gt;
  
                  &lt;td&gt;&lt;/td&gt;
  </code></pre>
  
  <p>the error i am getting is on this line</p>
  
  <pre><code>&lt;%: RunningTotal += (item.tblPerson.tblCourseWantedHours.Where(x =&gt; x.Semester == item.Semester).Sum(x =&gt; x.WantedHoursPerWeek + x.UL + x.UT) - allowedHours) %&gt;
  </code></pre>
  
  <p>error description is</p>
  
  <pre><code>CS0266: Cannot implicitly convert type 'double?' to 'double'. An explicit conversion exists (are you missing a cast?)
  </code></pre>
  
  <p>any idea what i am missing here?</p>