Grow your CSS skills. Land your dream job.

hi i want retrive data with image from xml file

  • # February 27, 2013 at 7:57 am

    Hi this is am using following code

    < ?xml version="1.0" encoding="utf-8"?>































    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]

    # February 27, 2013 at 9:04 am

    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)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".