I am having difficulty getting rid of duplicate entries which are showing up in autocomplete.
The autocomplete is generated dynamically from a database.
This is the code which is being used for the autocomplete in the control:
public ActionResult AutoCompletefootball()
{
var db = new footEntities();
string selection = this.Request.Params["term"].ToString();
return Json(db.football.Where(a => a.player.Name.StartsWith(selection)).Select(Adds => a.Player.Name), JsonRequestBehavior.AllowGet);
}
All advice welcome
In your return statement (where you use LINQ), add DISTINCT clause.