autocomplete display distinct items
<p>How do I display distinct items in the autocomplete list? I don't want the duplicates to show up in the list. I'm reading the data from an XML file.</p>

<p>Here's my web service code:</p>

<p>[WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ScriptService]</p>

<pre><code>public class WebService : System.Web.Services.WebService
{
    [WebMethod]
    public string[] GetItemsList(string prefixText, int count)
    {
        List&lt;string&gt; suggestions = new List&lt;string&gt;();
        using (XmlTextReader reader = new XmlTextReader(HttpContext.Current.Server.MapPath("flightdata3.xml")))
        {
            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element &amp;&amp; reader.Name == "departurelocation")
                {
                    string itemName = reader.ReadInnerXml();
                    if (itemName.StartsWith(prefixText, StringComparison.InvariantCultureIgnoreCase))
                    {
                        suggestions.Add(itemName);

                        if (suggestions.Count == count) break;
                    }
                }

                if (reader.NodeType == XmlNodeType.Element &amp;&amp; reader.Name == "destinationlocation")
                {
                    string itemName = reader.ReadInnerXml();
                    if (itemName.StartsWith(prefixText, StringComparison.InvariantCultureIgnoreCase))
                    {
                        suggestions.Add(itemName);

                        if (suggestions.Count == count) break;
                    }
                }

            }
        }
        return suggestions.ToArray();
    }
}
</code></pre>
