protected void ddlSelectSector_SelectedIndexChanged(object sender, EventArgs e) { int sectorId = SafeConvert.ToInt32(ddlSelectSector.SelectedValue); var empList = _service.GetEmployeeDutyByToSector_Id(sectorId).Where(x => x.EndDate <= DateTime.Today && x.ToSector_Id == sectorId).ToList(); ddlRollNo.Bind(empList, "EmployeeIdName", "Employee_Id"); }