private void GetApplicant() { try { ddlApplicantName.DataSource = ApplicantData.GetSortedApplicants(); ddlApplicantName.DataValueField = "appnameid"; ddlApplicantName.DataTextField = "Applicantname"; ddlApplicantName.DataBind(); ddlApplicantName.Items.Insert(0, new ListItem("Select", "NA")); } catch (Exception ex) { lblErrorMsg.Text = ex.Message; } }
protected void BindApplicants(DropDownList ddList) { try { ddList.Items.Clear(); ddList.DataSource = ApplicantData.GetSortedApplicants(); ddList.DataValueField = "appnameid"; ddList.DataTextField = "Applicantname"; ddList.DataBind(); ddList.Items.Insert(0, new ListItem("Select", "NA")); } catch (Exception ex) { LogError(Pagename, "BindApplicants", "", ex.Message); } }