Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8662629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:46:47+00:00 2026-06-12T16:46:47+00:00

Problem : I have data I’ve saved into an XML file, but when I

  • 0

Problem : I have data I’ve saved into an XML file, but when I re-open the application, the data in the XML file should be populating my listbox but nothing shows up. I’ve been at this for 2 hours and cannot find the problem.

My code to load xml file :

public void Load()
{
    XDocument myDoc = XDocument.Load(".../.../parking.xml");

    var ticks = from xElem in myDoc.Descendants("Ticket")
               select new Ticket
               {
                   TimeIn = Convert.ToDateTime(xElem.Element("TimeIn").Value),
                   TicketNum = Convert.ToInt32(xElem.Element("TicketNumber").Value),
               };

    this.Clear();

    AddRange(ticks);
}

And my code to try to populate the listbox :

{
        newList = new TickList();

        newList.Load();

        foreach (var nTick in newList)
        {
            spotList.Items.Add(nTick.ToString());
        }
    }

EDIT : http://pastebin.com/YwPj0Nxc

Couldn’t find a good way to format that on this site, but that’s the XML file.

Smurf Edit: Adding pastebin XML

<?xml version="1.0" encoding="utf-8"?>
<Tickets>
  <Ticket>
    <TicketNum>1</TicketNum>
    <TimeIn>2012-10-11T17:49:49.896445-05:00</TimeIn>
  </Ticket>
  <Ticket>
    <TicketNum>2</TicketNum>
    <TimeIn>2012-10-11T17:49:50.2714664-05:00</TimeIn>
  </Ticket>
  <Ticket>
    <TicketNum>3</TicketNum>
    <TimeIn>2012-10-11T17:49:50.4304755-05:00</TimeIn>
  </Ticket>
  <Ticket>
    <TicketNum>4</TicketNum>
    <TimeIn>2012-10-11T17:49:50.5944849-05:00</TimeIn>
  </Ticket>
</Tickets>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:46:48+00:00Added an answer on June 12, 2026 at 4:46 pm

    Can’t answer without looking at the XML file itself. Make sure all the attributes and names match with the query. Make sure the TicketList has data before you bind it to the ListBox. You need extensive debugging. I think the problem is your Linq query. You need to simplify your LINQ query.

    Update: Your element names are not matching. I think the LINQ is also missing its outer “Tickets” element. It should go each element inside “Tickets”. It says “TicketNum”, but the XML has “TicketNumber”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am getting problem as i have some data in a database tabel file
I have problem while loading data into html select when users press or click
I have problem SIMILAR to preventing form data reposting, but not quite the same
I have problem with this code: file = tempfile.TemporaryFile(mode='wrb') file.write(base64.b64decode(data)) file.flush() os.fsync(file) # file.seek(0)
Hey I am new to Httparty. I can fetch data but have problem posting
i have a problem with getting content from a XML into a mysql database.
I have problem in splitting data. I have data as follows in CSV file:
I have the following problem: i have some data loaded in my application, that
Here's the problem: I have a data-bound list of items, basically a way for
I make the problem shorter. Actually I have data much longer than this. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.