Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other hi i want retrive data with image from xml file

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #42984
    WPhone7
    Member

    Hi this is am using following code































    var query =from l in xmlDoc.Descendants(“Person”)
    select new Notch
    {
    name = (string)l.Attribute(“name”),
    Detail = l.Element(“Details”)
    .Elements(“detail”).Select(x => x.Attribute(“games”).ToString()).ToList()
    Image = l.Element(“Details”)
    .Elements(“detail”)
    .Elements(“event_image”)
    .Elements(“image”)
    .Select(x => x.Attribute(“url”).ToString()).ToList()
    };
    foreach (var category in query)
    {
    Console.WriteLine(category);
    }

    NotchsList.ItemsSource = query.ToList();

    I using this code but i got output like

    Raja

    System.Collection.Generic.List’1[System.String]

    System.Collection.Generic.List’1[System.String]

    Rama

    System.Collection.Generic.List’1[System.String]

    System.Collection.Generic.List’1[System.String]

    #126296
    Mottie
    Member

    Hi WPhone7!

    First off that is not valid XML. There are neither `event_image` nor `Peoples` closing tags. And one image tag has a `1` stuck at the end: ``.

    Secondly, I think you’re asking a c# question in forums that only has categories for php, css and javascript. You might get help from someone that knows c# over on [StackOverflow](http://stackoverflow.com).

    I would help, but I have no clue.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Other’ is closed to new topics and replies.