public static List<string> GetCountry(string prefixText) { try { DataTable dt = new DataTable(); SearchResumeREBAL searchResumeBAL = new SearchResumeREBAL(); dt = searchResumeBAL.GetCountryBAL(prefixText); List<string> rolename = new List<string>(); for (int i = 0; i < dt.Rows.Count; i++) { rolename.Add(dt.Rows[i][1].ToString()); } return rolename; } catch (Exception) { throw; } }
private void GetCountry() { try { SearchResumeREBAL searchResumeBAL = new SearchResumeREBAL(); DataSet dsCountry = new DataSet(); dsCountry = searchResumeBAL.GetCountryBAL(); if (dsCountry != null) { ddlWorkPermit.DataSource = dsCountry; ddlWorkPermit.DataTextField = "CountryName"; ddlWorkPermit.DataValueField = "CountryId"; ddlWorkPermit.DataBind(); ddlWorkPermit.Items.Insert(0, new ListItem("--Select--", "0")); } } catch (Exception) { throw; } }