public static List <string> SearchCountries(string prefixText, int count) { List <string> countries = CountryDao.GetAllCountries(); List <string> matchList = new List <string>(); var matches = from country in countries where country.ToLower().StartsWith(prefixText.ToLower()) select country; foreach (string item in matches) { matchList.Add(item); } return(matchList); }