public void PopulateCombos() { try { DdlEmpId.DataSource = objEmp.ShowEmp(); DdlEmpId.DataTextField = "Emp_FirstName"; DdlEmpId.DataValueField = "EmpId"; DdlEmpId.DataBind(); DdlEmpId.Items.Insert(0, "Select"); DdlVisaTypeId.DataSource = objVisaType.ShowVisaType(); DdlVisaTypeId.DataTextField = "VisaTypeName"; DdlVisaTypeId.DataValueField = "VisaTypeId"; DdlVisaTypeId.DataBind(); DdlVisaTypeId.Items.Insert(0, "Select"); DdlPassportId.DataSource = objPassport.ShowEmployeePassport(); DdlPassportId.DataTextField = "PassportId"; DdlPassportId.DataValueField = "PassportId"; DdlPassportId.DataBind(); DdlPassportId.Items.Insert(0, "Select"); DdlCountryId.DataSource = objVisaType.ShowCountries(); DdlCountryId.DataTextField = "CountryName"; DdlCountryId.DataValueField = "COuntryId"; DdlCountryId.DataBind(); DdlCountryId.Items.Insert(0, "Select"); } catch (Exception ex) { lblMsg.Text = ex.Message; } }
public void PopulateCombo() { try { DdlPassportNo.DataSource = objPassport.ShowEmployeePassport(); DdlPassportNo.DataTextField = "PassportNo"; DdlPassportNo.DataValueField = "PassportNo"; DdlPassportNo.DataBind(); DdlPassportNo.Items.Insert(0, "Select"); DdlPassportId.DataSource = objPassport.ShowEmployeePassport(); DdlPassportId.DataTextField = "PassportId"; DdlPassportId.DataValueField = "PassportId"; DdlPassportId.DataBind(); DdlPassportId.Items.Insert(0, "Select"); } catch (Exception ex) { lblMsg.Text = ex.Message; } }