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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:05:12+00:00 2026-05-25T00:05:12+00:00

I am novice and struggling in some XML operations Like open and Delete. I

  • 0

I am novice and struggling in some XML operations Like open and Delete. I have done the Add part.

Partys.xml

<?xml version="1.0" encoding="utf-8"?>
<Partys>
  <Customers>
    <Customer CustomerID="1">
      <PersonalName>
        <LastName>Baker</LastName>
        <FirstName>Eugene</FirstName>
      </PersonalName>
      <Citizenship>Africa</Citizenship>
    </Customer>
    <Customer CustomerID="2">
      <PersonalName>
        <LastName>Baker</LastName>
        <FirstName>Eugene</FirstName>
      </PersonalName>
      <Citizenship>Africa</Citizenship>
    </Customer>
  </Customers>
 </Partys>

Q: I want to open the node detail customer where CustomerID (Attribute) is 1. What is the C# code for this?

Q: I want to delete the node customer where CustomerID (Attribute) is 2. What is the C# code for this?

  • 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-25T00:05:12+00:00Added an answer on May 25, 2026 at 12:05 am

    You could try something like this:

    XmlDocument xmlDoc = new XmlDocument();
    xmlDoc.Load("Parties.xml");
    XmlNode t = xmlDoc.SelectSingleNode("/Partys/Customers/Customer[@CustomerID='2']");
    t.ParentNode.RemoveChild(t);
    xmlDoc.Save();
    

    Once you have t, you can do whatever you want with it including show it in the Console (by accessing the various properties)

    Here, we have deleted the node and saved back to file, but you could do whatever you want with the XmlDocument….

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

Sidebar

Related Questions

I'm a python novice and am struggling with some concepts here - any help
A novice R user here. So i have a data set formated like: Date
I'm quite a novice with PHP, but would like some assistance with how to
I'm a crappy novice programmer and have been struggling to get this working for
I am a novice programmer and as a part of my project I have
I am struggling with a simple JAXB customization issue. I have an schema like
I'm a novice in XSLT and I'm struggling a lot with this issue: I
Python novice here. I am using python2.7.2 on Windows7. I have installed the PyWin32
I am a bash novice and I am struggling with putting it all together.
I am a novice to IOS programming hence struggling a bit with the below

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.