public string[] GetAssociateName(string prefixText, int count, string contextKey) { CustomerBo customerBo = new CustomerBo(); DataTable dtAssociateName = new DataTable(); int i = 0; List <string> names = new List <string>(); dtAssociateName = customerBo.GetAssociateNameDetails(prefixText, int.Parse(contextKey)); //string[] customerNameList = new string[dtCustomerName.Rows.Count]; foreach (DataRow dr in dtAssociateName.Rows) { string item = AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(dr["AA_ContactPersonName"].ToString(), dr["AA_AdviserAssociateId"].ToString()); names.Add(item); } return(names.ToArray()); }