public string[] GetMatterType(string prefixText, int count) { MatterView BEL = new MatterView(); DataTable dt = BEL.SelectLikeDataMatterType(prefixText.ToUpper()); List <string> txtItems = new List <string>(); String dbValues; foreach (DataRow row in dt.Rows) { //String From DataBase(dbValues) dbValues = row["Matter_Type_Desc"].ToString().ToUpper(); dbValues = dbValues.ToUpper(); txtItems.Add(dbValues); if (txtItems.Count > count) { return(txtItems.ToArray()); } } return(txtItems.ToArray()); }