Home/ASP.NET Forums/Data Access/XML and XmlDataSource Control/Non white space characters cannot be added to content.

Non white space characters cannot be added to content.  [Answered]RSS

5 replies

Last post Dec 23, 2010 02:35 PM by kbainey1

  • kbainey1 kbainey1

    Member

    48 Points

    425 Posts

    Re: Non white space characters cannot be added to content.

    Dec 23, 2010 02:35 PM|kbainey1|LINK

    I finally got it:

    XDocument doc =  XDocument.Parse(xmlResponse);
    
    
                    var query = from q in doc.Descendants("Contact")
                                select new
                                {
                                    FullName = ((q.Element("FirstName") != null ? q.Element("FirstName").Value : "") + ", " + (q.Element("LastName") != null ? q.Element("LastName").Value : ""))
                                };
                    List<string> list = new List<string>();
                    foreach (var r in query)
                    {
      
    
                        list.Add( r.FullName);
                    }
                    list.Sort();
                    list.Distinct();
                    ddName.DataSource = list;
                    ddName.DataBind();


     

  • ‹ Previous Thread|Next Thread ›