title: 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' 'object' does not contain a definition for 'intEmployeeId'
body: <p>I am getting an exception when i trying to display the values of viewbag. I have joined two tables and stored that data in viewbag using Linq.</p>
  
  <p>This is my controller action method</p>
  
  <pre><code>    public ActionResult HRSeparationDetails()
      {
          //List&lt;trnEsSeparationDetail&gt; separationlist = (from list in db.trnEsSeparationDetails
          //                                              select list).ToList();
  
  
          ViewBag.SeparationList = (from list in db.trnEsSeparationDetails
                                                        join R in db.mstEsEmpReasonForSeparations
                                                            on list.ReasonForSeperationId equals R.intSeperationId
                                                        select new
                                                        {
                                                            intEmployeeId = list.intEmpId,
                                                            ReasonForSeparation = R.txtReasonForSeperation,
                                                            ResiganationDate = list.dtResignationDate,
                                                            RelievingDate = list.dtRequestedRelievingDate,
                                                            SeparationRemarks = list.txtRemark
                                                        }).ToList();
  
           return View();
      }
  </code></pre>
  
  <p>This is my viewpage</p>
  
  <pre><code>     @model IEnumerable&lt;EMPApp.Models.trnEsSeparationDetail&gt;
       @{
       ViewBag.Title = "HRSeparationDetails";
          Layout = "~/Views/Shared/_Layout.cshtml";
       }
  
        &lt;h2&gt;HRSeparationDetails&lt;/h2&gt;
        &lt;div&gt;
       @if (ViewBag.SeparationList == null)
      {
          &lt;div style="color:green"&gt;&lt;h3&gt;@ViewBag.SeparationerrorMessage&lt;/h3&gt;&lt;/div&gt;
      }
      else
      { 
          &lt;table class="grid" cellpadding="0" cellspacing="0"&gt;
              &lt;tr&gt;
                  &lt;th&gt;
                      &lt;b&gt;Employee Id&lt;/b&gt;
                  &lt;/th&gt;
                  @*&lt;th&gt;
                      &lt;b&gt;ReasonForSeparationId&lt;/b&gt;
                  &lt;/th&gt;*@
                  &lt;th&gt;
                      &lt;b&gt;Reason For Separation&lt;/b&gt;
                  &lt;/th&gt;
                  &lt;th&gt;
                      &lt;b&gt;Resignation Date&lt;/b&gt;
                  &lt;/th&gt;
                  &lt;th&gt;
                      &lt;b&gt;Relieving Date&lt;/b&gt;
                  &lt;/th&gt;
                  &lt;th&gt;
                      &lt;b&gt;Separation Remarks&lt;/b&gt;
                  &lt;/th&gt;
              &lt;/tr&gt;
              @foreach (var item in ViewBag.SeparationList)
              {
                  &lt;tr&gt;
                      &lt;td&gt;
                          @item.intEmployeeId
                          @*@{
                              Session["SeparationEmpId"] = item.intEmpId;
                          }
                          @Html.ActionLink(Session["SeparationEmpId"].ToString(), "EmployeeDashboard", "HRAdmin", new { id = @item.intEmpId }, null)*@
                      &lt;/td&gt;
                      @*&lt;td&gt;
                          @item.ReasonForSeperationId
                      &lt;/td&gt;*@
                      &lt;td&gt;
                          @item.ReasonForSeparation
                      &lt;/td&gt;
                      &lt;td&gt;
                          @item.ResiganationDate
                      &lt;/td&gt;
                      &lt;td&gt;
                          @item.RelievingDate
                      &lt;/td&gt;
                      &lt;td&gt;
                          @item.SeparationRemarks
                      &lt;/td&gt;
                  &lt;/tr&gt;
              }
          &lt;/table&gt;
      }
  </code></pre>
  
  <p></p>
  
  <p>Any help will be appreciated. Thanks..</p>