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

  • SEARCH
  • Home
  • 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 652121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:14:14+00:00 2026-05-13T22:14:14+00:00

I’m planning to create a news item which uses xml as it’s backend and

  • 0

I’m planning to create a news item which uses xml as it’s backend and the Display should be like:

Date: 08/Mar/2010
——————————
Title     | News
——————————
News 4 | Some news
News 3 | Some news
News 2 | Some news
News 1 | Some news
——————————
Date: 07/Mar/2010
——————————
Title     | News
——————————
News 5 | Some news
News 4 | Some news
News 3 | Some news
News 2 | Some news
News 1 | Some news

  1. Display should be sorted on Date (descending)
  2. Then news items should be sorted on time (descending)

Today’s news item should be on top, then titles should be sorted-decending (timewise), later will come previous day’s news items.

I’m not able to come up with the logic of xml which should be used in this case. moreover I’m not able to figure out how should I check “Today’s date” in xml’s “if” statement. Can I please get some code sample to understand this kinda logic???

—- Previous Question ——————————————————————
How can I export a data from textBox1, textBox2 & textBox3 on my winform (visual studio C#) so that it can automatically create an xml file with proper placing of these data????

Let’s say:
textBox1 = Name:
textBox2 = Age:
textBox3 = Roll No

It would be great if the exported xml can be appended (add the new data in the EOF) if we export the data again.

Any idea plz…..

  • 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-13T22:14:15+00:00Added an answer on May 13, 2026 at 10:14 pm

    I was able to figure out the answer and was able to make my 1st trial with xml a success. I was trying to work with xml and C#. So I started on with a small thing:

    1. A windows form to accept Employee Department, name, and Emp No.
    2. On the press of “Submit” button the xml will be written, then all textbox
      will be cleared, and xml will be
      displayed to the user.

    Here’s the working code of button click.

    private void button1_Click(object sender, EventArgs e)
            {
                string path = "employee.xml";
                if (File.Exists(path))
                {
                    // to append a new user having reset the textboxes
                    XDocument doc = XDocument.Load(path);
                    XElement xe = new XElement("user",
                        new XElement("department", textBox1.Text),
                        new XElement("name", textBox2.Text),
                        new XElement("empno", textBox3.Text)
                        );
                    doc.Root.Add(xe);
                    doc.Save(path);
                }
                else
                {
                new XDocument(
                    new XElement("users",
                        new XElement("user",
                        new XElement("department", textBox1.Text),
                        new XElement("name", textBox2.Text),
                        new XElement("empNo", textBox3.Text)
                        )
                    )
                    ).Save(path);
                }
                textBox1.Text="";
                textBox2.Text="";
                textBox3.Text="";
                MessageBox.Show("Data added successfully","Done!!",MessageBoxButtons.OK);
                this.button1.Enabled=false;
                f2=new Form2();
                f2.FormClosed += Form2_FormClosed;
                f2.Show();
            }
    

    Sadly I was not able to get any help from here(Stackoverflow) for editing the xml… so I decided to share the code with everybody here. Maybe this answer will help someone new like me.

    This code could be modified with better skills and utilities, and if somebody has time & interest in helping a newbie then please do come forward.

    Gud luck to all newbies here 🙂

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
In my XML file chapters tag has more chapter tag.i need to display chapters
I would like to run a str_replace or preg_replace which looks for certain words
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace

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.