how do i save the changes?
-
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?
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.
-
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.
-
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?
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.
-
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.
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[^]