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
  1. Home
  2. General Programming
  3. C#
  4. how do i save the changes?

how do i save the changes?

Scheduled Pinned Locked Moved C#
questioncsharpdata-structuresxml
5 Posts 3 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.
  • S Offline
    S Offline
    samidhas
    wrote on last edited by
    #1

    i am accessing the xml file through the c# in tree view. so how can i save the changes which ihave made in tree view in xml file?

    N C 2 Replies Last reply
    0
    • S samidhas

      i am accessing the xml file through the c# in tree view. so how can i save the changes which ihave made in tree view in xml file?

      N Offline
      N Offline
      Naveed727
      wrote on last edited by
      #2

      when you read the file first time save the information with your self. e,g save it in string what changing you are you going to made now you can easly change the string at the last you can write down you whole file again. This is my idea i am working in this way.

      S 1 Reply Last reply
      0
      • N Naveed727

        when you read the file first time save the information with your self. e,g save it in string what changing you are you going to made now you can easly change the string at the last you can write down you whole file again. This is my idea i am working in this way.

        S Offline
        S Offline
        samidhas
        wrote on last edited by
        #3

        can u plz send me sample code?

        1 Reply Last reply
        0
        • S samidhas

          i am accessing the xml file through the c# in tree view. so how can i save the changes which ihave made in tree view in xml file?

          C Offline
          C Offline
          ChrisKo 0
          wrote on last edited by
          #4

          Look at the following overloads for the XmlDocument.Save() method. http://msdn2.microsoft.com/en-us/library/system.xml.xmldocument.save(VS.80).aspx[^] I hope you were using the XmlDocument class to make the changes to the original XML. If you aren't, then you should definitely take a look there as it will make things easier for you. I just realized you said you were using a databound treeview to access the XML. I've never actually used that, so ignore my response.

          C 1 Reply Last reply
          0
          • C ChrisKo 0

            Look at the following overloads for the XmlDocument.Save() method. http://msdn2.microsoft.com/en-us/library/system.xml.xmldocument.save(VS.80).aspx[^] I hope you were using the XmlDocument class to make the changes to the original XML. If you aren't, then you should definitely take a look there as it will make things easier for you. I just realized you said you were using a databound treeview to access the XML. I've never actually used that, so ignore my response.

            C Offline
            C Offline
            ChrisKo 0
            wrote on last edited by
            #5

            I did a quick look and it appears you should be using the XmlDataSource for the TreeView's Datasource. There is a Save method on the XmlDataSource, so I would start there and see what you can figure out. http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.xmldatasource.save(VS.80).aspx[^]

            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