Breaking News
Loading...
Monday 10 December 2012

Add new node(Element) in existing xml file in C#.Net

first make form like :




-  now double click on button and write code like :

/////////////////////////   CODE    ////////////////////////////


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Xml;
using System.Windows.Forms;

namespace Xml_File_Operation
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
         private void button3_Click(object sender, EventArgs e)
        {

           
               XmlDocument xdoc1 = new XmlDocument();
                xdoc1.Load("C:\\Users\\Nirav\\Desktop\\people1.xml");
                XmlNode person = xdoc1.CreateElement("person");
                XmlNode name = xdoc1.CreateElement("name");
                name.InnerText = textBox1.Text;
                person.AppendChild(name);

                XmlNode age = xdoc1.CreateElement("age");
                age.InnerText = numericUpDown1.Value.ToString();
                person.AppendChild(age);

                XmlNode email= xdoc1.CreateElement("email");
                email.InnerText = textBox3.Text;
                person.AppendChild(email);

                xdoc1.DocumentElement.AppendChild(person);
                xdoc1.Save("C:\\Users\\Nirav\\Desktop\\people1.xml");

            }

      }
}


//////////////////         OUTPUT      ////////////////////////



it make chanch like :


                  




--
/\/ir@\/  <(.'.)>

136 comments:

  1. Nice Block It is very helpful.... Thanks a lot for your help...

    ReplyDelete
  2. very helpful thanks for sharing... :)

    ReplyDelete
  3. i created a page to add nodes and saving on sql server in one button.But the nodes and added lokk like this ...(nodes are added at straight)..why?
    plese sugggest any solutions?

    ReplyDelete
  4. This comment has been removed by a blog administrator.

    ReplyDelete
  5. This comment has been removed by a blog administrator.

    ReplyDelete
  6. This comment has been removed by a blog administrator.

    ReplyDelete
  7. This comment has been removed by a blog administrator.

    ReplyDelete
  8. This comment has been removed by a blog administrator.

    ReplyDelete
  9. This comment has been removed by a blog administrator.

    ReplyDelete
  10. This comment has been removed by a blog administrator.

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. This comment has been removed by a blog administrator.

    ReplyDelete
  13. This comment has been removed by a blog administrator.

    ReplyDelete
  14. I have a problem. Visual Studio showed me this : "An unhandled exception of type 'System.IO.FileNotFoundException' occurred in System.Xml.dll

    Additional information: Cannot find file'C:\Users\Administrator\Desktop\test.xml'.

    ReplyDelete
    Replies
    1. Hello,
      First you have to make XML file and then save it to desktop with test.xml name and then run program

      Delete
  15. This article is very much helpful and I hope this will be a useful information for the needed one. Keep on updating these kinds of informative things...
    Selenium Training in Chennai

    ReplyDelete
  16. This comment has been removed by the author.

    ReplyDelete

  17. I wish to show thanks to you just for bailing me out of this particular trouble.As a result of checking through the net and meeting techniques that were not productive, I thought my life was done.
    Advanced Selenium Training in Chennai

    ReplyDelete
  18. Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition
    Best RPA Training in Bangalore


    Best RPA Training in Chennai

    ReplyDelete
  19. Existing without the answers to the difficulties you’ve sorted out through this guide is a critical case, as well as the kind which could have badly affected my entire career if I had not discovered your website.
    google-cloud-platform-training-in-chennai


    ReplyDelete
  20. Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition.
    Best Java Training Institute Chennai
    Java Training Institute Bangalore

    ReplyDelete
  21. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.

    Best RPA Training in Chennai
    Best RPA Training in Bangalore

    ReplyDelete
  22. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.
    amazon-web-services-training-in-bangalore

    ReplyDelete
  23. Thank you a lot for providing individuals with a very spectacular possibility to read critical reviews from this site.


    Best Java Training Institute Chennai

    Amazon Web Services Training in Chennai


    ReplyDelete
  24. This comment has been removed by the author.

    ReplyDelete
  25. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.

    Best Java Training Institute Chennai


    Amazon Web Services Training in Chennai


    ReplyDelete
  26. Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area.

    RPA Training in Bangalore

    ReplyDelete
  27. Ciitnoida provides Core and java training institute in

    noida
    . We have a team of experienced Java professionals who help our students learn Java with the help of Live Base Projects. The object-

    oriented, java training in noida , class-based build

    of Java has made it one of most popular programming languages and the demand of professionals with certification in Advance Java training is at an

    all-time high not just in India but foreign countries too.

    By helping our students understand the fundamentals and Advance concepts of Java, we prepare them for a successful programming career. With over 13

    years of sound experience, we have successfully trained hundreds of students in Noida and have been able to turn ourselves into an institute for best

    Java training in Noida.

    java training institute in noida
    java training in noida
    best java training institute in noida
    java coaching in noida
    java institute in noida

    ReplyDelete
  28. Excellent Article!
    Thanks for sharing that wonderful useful information,given contecn was very excellent and easily observe all provided information.

    Final Year Bsc Projects Chennai | Final Year BTech Projects in Chennai.

    ReplyDelete
  29. Your new valuable key points imply much a person like me and extremely more to my office workers. With thanks; from every one of us.
    AWS Online Training

    ReplyDelete
  30. The young boys ended up stimulated to read through them and now have unquestionably been having fun with these things.
    Hadoop Training in Bangalore
    Hadoop Training in Chennai

    ReplyDelete
  31. I prefer to study this kind of material. Nicely written information in this post, the quality of content is fine and the conclusion is lovely. Things are very open and intensely clear explanation of issues
    Click here:
    Microsoft azure training in tambaram
    Click here:
    Microsoft azure training in chennai

    ReplyDelete
  32. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
    Devops Training in pune

    Devops Training in Chennai

    Devops Training in Bangalore

    AWS Training in chennai

    AWS Training in bangalore

    ReplyDelete
  33. Thanks for the good words! Really appreciated. Great post. I’ve been commenting a lot on a few blogs recently, but I hadn’t thought about my approach until you brought it up. 

    Blueprism training in annanagar

    Blueprism training in velachery

    Blueprism training in marathahalli


    AWS Training in chennai

    AWS Training in bangalore

    ReplyDelete
  34. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
    Devops Training in pune|Devops training in tambaram|Devops training in velachery|Devops training in annanagar

    ReplyDelete
  35. Impressive. Your story always bring hope and new energy. Keep up the good work.
    python training in tambaram
    python training in annanagar
    python training in OMR

    ReplyDelete
  36. Very good brief and this post helped me alot. Say thank you I searching for your facts. Thanks for sharing with us!
    java training in chennai | java training in USA

    selenium training in chennai


    ReplyDelete
  37. Thank you for benefiting from time to focus on this kind of, I feel firmly about it and also really like comprehending far more with this particular subject matter. In case doable, when you get know-how, is it possible to thoughts modernizing your site together with far more details? It’s extremely useful to me.
    Data Science course in kalyan nagar | Data Science course in OMR
    Data Science course in chennai | Data science course in velachery
    Data science online course | Data science course in jaya nagar

    ReplyDelete
  38. I simply wanted to write down a quick word to say thanks to you for those wonderful tips and hints you are showing on this site.
    java training in chennai | java training in bangalore

    java interview questions and answers | core java interview questions and answers

    ReplyDelete
  39. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
    Data Science course in Chennai | Data science course in bangalore
    Data science course in pune | Data science online course
    Data Science Interview questions and answers | Python course in Kalyan nagar

    ReplyDelete
  40. You got an extremely helpful website I actually have been here reading for regarding an hour. I’m an initiate and your success is incredibly a lot of a concept on behalf of me.
    angularjs Training in btm

    angularjs Training in electronic-city

    angularjs online Training

    angularjs Training in marathahalli

    angularjs interview questions and answers

    ReplyDelete
  41. I’m bookmarking and will be tweeting this to my followers! Wonderful blog and amazing design and style.
    safety course in chennai

    ReplyDelete
  42. Thanks for making me this article. You have done a great job by sharing this content in here. Keep writing article like this.

    React Training
    React Training in Chennai

    ReplyDelete
  43. Whoa! I’m enjoying the template/theme of this website. It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between superb usability and visual appeal. I must say you’ve done a very good job with this.

    AWS Training in Bangalore | Amazon Web Services Training in bangalore , india

    AWS Training in pune | Amazon Web Services Training in Pune, india

    ReplyDelete

  44. Hey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
    AWS Training in Chennai
    Data Science Training in Chennai
    Python Training in Chennai
    RPA Training in Chennai
    Digital Marketing Training in Chennai

    ReplyDelete
  45. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.

    informatica mdm online training

    apache spark online training

    apache spark online training

    devops online training

    aws online training

    ReplyDelete
  46. Thank you for taking the time to provide us with your valuable information. We strive to provide our candidates with excellent care and we take your comments to heart.As always, we appreciate your confidence and trust in us
    Microsoft Azure online training
    Selenium online training
    Java online training
    Python online training
    uipath online training

    ReplyDelete
  47. Thanks for sharing this information, it helps me to learn new things. Continue sharing more like this.
    Best Python Training Institute in Chennai

    ReplyDelete
  48. marvellous!i really want to say that everyone will get new thoughts after read your post and you have narrated beautiful ideas
    Android Training in Chennai
    Android Training in Tambaram
    Python Training in Chennai
    Android Training in Chennai
    Android Training in T Nagar

    ReplyDelete
  49. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    CCC Result 2020

    ReplyDelete
  50. I am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.

    business analytics course

    data analytics courses

    data science interview questions

    data science course in mumbai

    ReplyDelete
  51. Nice Article.very impressed for this informative
    ExcelR data analytics courses

    ReplyDelete
  52. Excellent blog with lots of information, keep sharing. I am waiting for your more posts like this or related to any other informative topic.Amazing web journal I visit this blog it's extremely marvelous. Interestingly, in this blog content composed plainly and reasonable. The substance of data is educationalData Science Training In Chennai

    Data Science Online Training In Chennai

    Data Science Training In Bangalore

    Data Science Training In Hyderabad

    Data Science Training In Coimbatore

    Data Science Training

    Data Science Online Training

    ReplyDelete
  53. Thanks for sharing information awesome blog post Online Education Quiz website For Exam Follow this website Gk in Hindi

    ReplyDelete
  54. http://niravdaraniya.blogspot.com/2012/12/add-new-nodeelement-in-existing-xml.html
    http://geospatialpython.com/2012/02/pyshp-shaperecords-method.html
    http://abc-afterglow.blogspot.com/2014/10/your-guide-to-googles-panda-41-algorithm.html
    http://green-manufacturing.blogspot.com/2014/06/the-internet-of-green-things.html
    http://security-orcl.blogspot.com/2015/02/oracle-information-security-partner.html
    https://blog-downloadandroid.blogspot.com/2017/02/cara-root-oppo-joy-r1001-dan-instal-cwm.html
    http://seminarsparkz.blogspot.com/2013/11/training-program-in-php-and-java-at.html
    http://thecrm2011blog.blogspot.com/2011/06/how-to-import-many-to-many.html
    https://www.minimilitiaproapk.com/join-and-share-whatsapp-group-links/

    ReplyDelete
  55. we are here for you guys to enhance your skills during this period. Our institution offering you CS executive classes and free CSEET classes. So guys for more info contact us or visit us at website https://uniqueacademyforcommerce.com/

    ReplyDelete
  56. Amazing opportunities came with amazing time and here is our institution offering you CS executive classes and a free of cost CSEET classes. So what are you waiting for contact us or visit our website
    cs executive
    freecseetvideolectures/

    ReplyDelete
  57. hi thanku so much this information this blog is very useful
    cs executive
    freecseetvideolectures/

    ReplyDelete
  58. Set An Alert For CHF USD To Receive An Email When The Exchange Rate Changes. Alternatively, Bookmark The Page And Check Back Here Regularly.

    ReplyDelete
  59. AximTrade Offers A Safe And Secure Platform To Do Forex Trading And CFDs And Our Customer Support Is Ready To Help You 24/7. You Can Easily Sign Up Your Aximtrade Login Account Here.

    ReplyDelete
  60. Download Aximtrade Reviews Mt4: A Complete Solution For Your Forex Trading.

    ReplyDelete
  61. Read More About The Latest XM REVIEW Review In This Article. Learn How The Broker Operates And If You Should Avoid Trading With It Or Not.

    ReplyDelete
  62. Are You Thinking About Joining AVATRADE REVIEW ? If You Are Then Read The Review On AVATRADE Fx In This Article. We, Will, Tell You About The Company, The Brokers, The Platform, And All The Information You Need To Know. Read More Here.

    ReplyDelete
  63. Took me time to understand all of the comments, but I seriously enjoyed the write-up. It proved to be really helpful to me and I'm positive to all of the commenters right here! Its constantly nice when you can not only be informed, but also entertained! I am certain you had enjoyable writing this write-up.
    data analytics course in hyderabad

    ReplyDelete
  64. Very interesting blog. Alot of blogs I see these days don't really provide anything that I'm interested in, but I'm most definately interested in this one. Just thought that I would post and let you know. data analytics course in surat

    ReplyDelete
  65. Your blog provided us with valuable information to work with. Each & every tips of your post are awesome. Thanks a lot for sharing. Keep blogging,
    data science training in hyderabad

    ReplyDelete
  66. Your blog is loaded with informative post
    jewellery shop management software
    Jewellery Shop Management Software

    ReplyDelete
  67. Your blog is loaded with informative post
    Jewellery ERP Software Dubai
    Jewellery ERP Software Dubai

    ReplyDelete
  68. Very informative Blog by you for the people who are new to this industry. Your detailed blog solves all the queries with good explanation. Keep up the good work. Thanks for sharing! We have a website too. Feel free to visit anytime.

    hadoop course in bangalore

    hadoop training in bangalore

    ReplyDelete
  69. Very informative Blog by you for the people who are new to this industry. Your detailed blog solves all the queries with good explanation. Keep up the good work. Thanks for sharing! We have a website too. Feel free to visit anytime.

    off shoulder dress for kids

    ReplyDelete
  70. I am exteremly impressed by your blog, because its very powerful for the new readers and have lot of information with proper explanation. Keep up the good work. Thanks for sharing this wonderful blog! We also have a website. Please check out whenever and wherever you see this comment.

    wedding card design online

    Wedding invitation video

    ReplyDelete
  71. I am exteremly impressed by your blog, because its very powerful for the new readers and have lot of information with proper explanation. Keep up the good work. Thanks for sharing this wonderful blog! We also have a website. Please check out whenever and wherever you see this comment.

    Image Compressor

    Quick Convert

    ReplyDelete
  72. Useful post thanks for sharing this post
    Building Contractors in Chennai

    ReplyDelete
  73. "Great tutorial! Your clear and concise instructions make adding new nodes to an existing XML file in C#.Net a breeze. 👍"
    Data Analytics Courses In Bangalore

    ReplyDelete
  74. This article likely provides guidance on how to add a new XML node or element to an existing XML file using C#.NET, which can be crucial for developers working with XML data in their applications.

    Data Analytics Courses In Kochi



    ReplyDelete
  75. Impressive. Your narrative always inspires optimism and fresh vitality. Continue your wonderful work.
    Data Analytics Courses in Agra

    ReplyDelete
  76. Hello,
    This code snippet is a clear and effective way to add a new node to an existing XML file in C#.NET. It's well-structured and easy to follow. Great job simplifying this task.
    Data Analytics Courses In Dubai

    ReplyDelete
  77. Wow! This blog post on adding a new node/element in an existing XML is an absolute gem for developers. The author brilliantly explains the process step by step, making it easy to follow along. If you are interested to know more about Data Analytics Courses In Pune,
    click here Data Analytics Courses In Pune

    ReplyDelete
  78. Great to know with this blog that code demonstrates a basic way to add a new node to an existing XML file in C#.Net.
    Data Analytics Courses In Chennai

    ReplyDelete
  79. good blog
    Data Analytics Courses In Vadodara

    ReplyDelete
  80. I appreciate your sharing of this information. I'm hopeful that the next time I encounter a blog, it will offer a more captivating and intellectually stimulating experience.
    data Analytics courses in leeds

    ReplyDelete
  81. This is an awesome post. Really very informative and creative content. This concept is a good way to enhance the knowledge. I like it and helps me to develop very well. Thank you for this brief explanation and very nice information.
    Investment Banking courses in bangalore

    ReplyDelete
  82. Bravo! Your elegant code effortlessly adds a touch of brilliance to XML manipulation. Thanks for sharing this insightful solution!

    Investment Banking Industry

    ReplyDelete

  83. "This blog offers a clear and concise guide for C#.NET developers looking to add new nodes to an existing XML file. The step-by-step instructions, along with code snippets, make it easy to understand and implement. The emphasis on manipulating XML elements dynamically within the C# environment is commendable. This resource is invaluable for anyone working with XML files in C#.NET and seeking efficient ways to modify their structure. A fantastic reference for XML manipulation!"
    Investment banking jobs in Mumbai

    ReplyDelete
  84. Thank you for sharing fantastic tutorial on how to Add new node(Element) in existing xml file in C#.Net.
    Digital marketing courses in woking

    ReplyDelete
  85. Hey there! Adding a new node (element) to an existing XML file in C#.Net can be really useful when we need to update or modify the XML data. By using C#.Net, we have the power to programmatically manipulate XML files and add new elements to them. It's a great way to dynamically manage and customize XML data. Thanks for bringing up this interesting topic!
    Data analytics courses in Rohini

    ReplyDelete

Thanks for comment

 
Toggle Footer