title: DataBinding does not contain a property
body: <p>Please help as i am new in c#</p>
  
  <p>i have facing the below error</p>
  
  <p>"DataBinding: 'Sherserve.CustomTypeLayer.EmployeeLeave' does not contain a property with the name 'empId' "</p>
  
  <p>here is my code :</p>
  
  <pre class="lang-cs prettyprint-override"><code>protected void Button1_Click(object sender, EventArgs e)
  {
      LMSManager leavestatus = new LMSManager();
      int emplid = Convert.ToInt32(Session["EmployeeID"]);
      List&lt;EmployeeLeave&gt; leaverecord = leavestatus.GetLeaveRecord(emplid);
  
      GridView1.DataSource = leaverecord;
      GridView1.DataBind();
  }
  </code></pre>
  
  <p>here is EmployeeLeave :</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class EmployeeLeave
  {
      public LeaveReason LeaveType { get; set; }
      public int EmployeeId { get; set; }
      public DateTime DateFrom { get; set; }
      public DateTime DateTo { get; set; }
      public string Reason { get; set; }
  }
  </code></pre>
  
  <p>here is aspx :</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" AllowPaging="True"
    PageSize="3" OnPageIndexChanging="GridView1_PageIndexchanging" CellPadding="4"
    ForeColor="#333333" Height="16px" 
    Style="margin-bottom: 0px; margin-right: 0px;"&gt;
    &lt;%-- DataSourceID="SqlDataSource1"--%&gt;
      &lt;AlternatingRowStyle BackColor="White" /&gt;
      &lt;FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /&gt;
      &lt;HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" /&gt;
      &lt;PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" /&gt;
      &lt;RowStyle BackColor="#FFFBD6" ForeColor="#333333" /&gt;
      &lt;SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" /&gt;
      &lt;SortedAscendingCellStyle BackColor="#FDF5AC" /&gt;
      &lt;SortedAscendingHeaderStyle BackColor="#4D0000" /&gt;
      &lt;SortedDescendingCellStyle BackColor="#FCF6C0" /&gt;
      &lt;SortedDescendingHeaderStyle BackColor="#820000" /&gt;
  
      &lt;Columns&gt;
          &lt;asp:TemplateField&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="lblEmpId" runat="server" Text='&lt;%#Eval("empId")%&gt;'/&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="lblLeaveType" runat="server" Text='&lt;%#Eval("LeaveType") %&gt;'/&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="lblempid" runat="server" Text='&lt;%#Eval("EmployeeId") %&gt;'/&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="lblDateFrm" runat="server" Text='&lt;%#Eval("DateFrom") %&gt;'/&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="lblDateTo" runat="server" Text='&lt;%#Eval("DateTo") %&gt;'/&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="lblRsn" runat="server" Text='&lt;%#Eval("Reason") %&gt;'/&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
      &lt;/Columns&gt;
  &lt;/asp:GridView&gt;
  </code></pre>