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 6699825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:44:30+00:00 2026-05-26T06:44:30+00:00

I have this xml file that i have created pragmatically using C# :- <Years>

  • 0

I have this xml file that i have created pragmatically using C# :-

<Years>
 <Year Year="2011">
  <Month Month="10">
    <Day Day="10" AccessStartTime="01:15 PM" ExitTime="01:15 PM" />
    <Day Day="11" AccessStartTime="01:15 PM" ExitTime="01:15 PM" />
    <Day Day="12" AccessStartTime="01:15 PM" ExitTime="01:15 PM" />
    <Day Day="13" AccessStartTime="01:15 PM" ExitTime="01:15 PM" />
   </Month>
   <Month Month="11">
    <Day Day="12" AccessStartTime="01:16 PM" ExitTime="01:16 PM" />
   </Month>
  </Year>
</Years>

I am having problems when i want to get specfic data from it while i am using XmlReader or i am doing it the wrong way cause each time the reader reads one single line and i what i want is to get a list of all days in a specific month and a year

  • 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-05-26T06:44:31+00:00Added an answer on May 26, 2026 at 6:44 am

    Use Linq-XML or post the code you have tried.

    var list = from ele in XDocument.Load(@"c:\filename.xml").Descendants("Year")
               select new  
                       {
                           Year = (string)ele.Attribute("Year"),
                           Month= (string)ele.Element("Month").Attribute("Month"),
                           Day = (string)ele.Element("Month").Element("Day").Attribute("Day")
                       };
    foreach (var t in list)
      {
         Console.WriteLine(t.Year + " " + t.Month + " " + t.Day );
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML file that starts like this: <Elements name=Entities xmlns=XS-GenerationToolElements> I'll have
--edited for clarity (hopefully) I have an XML file that looks something like this:
I have an eclipse's .classpath file that looks like this: <?xml version=1.0 encoding=UTF-8?> <classpath>
Aloha, I have a 8MB XML file that I wish to deserialize. I'm using
I have a program that stores it's information in an XML file. This file
I have an XML File that looks like this: <?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
In the past I have created a php file that generates the XML and
I have created this php script, to create an xml-file from my database: <?php
I have a dynamically created xml file that contains a record with five descriptor
I have this xml file <?xml version=1.0 encoding=UTF-8?> <bo:C837ClaimParent xsi:type=bo:C837ClaimParent xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:bo=http://somelongpathHere/process/bo> <claimAux> ...

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.