Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. append data in xml file

append data in xml file

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netxmlquestion
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pinna_hari
    wrote on last edited by
    #1

    hello, when i am trying to write data to xml file, what is the code for appending data to xml file in asp.net i am writing below code

    ds.WriteXml(AppDomain.CurrentDomain.BaseDirectory & "\XML\XMLfile.xml")

    Thanks

    Pinna

    C B 2 Replies Last reply
    0
    • P pinna_hari

      hello, when i am trying to write data to xml file, what is the code for appending data to xml file in asp.net i am writing below code

      ds.WriteXml(AppDomain.CurrentDomain.BaseDirectory & "\XML\XMLfile.xml")

      Thanks

      Pinna

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      you can't append to an XML file with another xml file, because an XML file can have only one root. You'd have to use the XmlDocument class to load the old xml and insert the new nodes.

      Christian Graus Driven to the arms of OSX by Vista.

      P 1 Reply Last reply
      0
      • C Christian Graus

        you can't append to an XML file with another xml file, because an XML file can have only one root. You'd have to use the XmlDocument class to load the old xml and insert the new nodes.

        Christian Graus Driven to the arms of OSX by Vista.

        P Offline
        P Offline
        pinna_hari
        wrote on last edited by
        #3

        ok...i want to append the new nodes to already created xml file.what is the code for appending nodes in already created xml file Thanks

        Pinna

        N 1 Reply Last reply
        0
        • P pinna_hari

          hello, when i am trying to write data to xml file, what is the code for appending data to xml file in asp.net i am writing below code

          ds.WriteXml(AppDomain.CurrentDomain.BaseDirectory & "\XML\XMLfile.xml")

          Thanks

          Pinna

          B Offline
          B Offline
          Brij
          wrote on last edited by
          #4

          To update an XML file you need xmldocument object Check the link [^]">

          Cheers!! Brij

          1 Reply Last reply
          0
          • P pinna_hari

            ok...i want to append the new nodes to already created xml file.what is the code for appending nodes in already created xml file Thanks

            Pinna

            N Offline
            N Offline
            N a v a n e e t h
            wrote on last edited by
            #5

            1 - Load it to XMLDocument using XMLDocument.Load 2 - Find the node under which you want the new node to be inserted 3 - Use AddChild method on that node.

            Navaneeth How to use google | Ask smart questions

            P 1 Reply Last reply
            0
            • N N a v a n e e t h

              1 - Load it to XMLDocument using XMLDocument.Load 2 - Find the node under which you want the new node to be inserted 3 - Use AddChild method on that node.

              Navaneeth How to use google | Ask smart questions

              P Offline
              P Offline
              pinna_hari
              wrote on last edited by
              #6

              Thanks you very much...

              Pinna

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups