Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C# (http://www.go4expert.com/forums/c-sharp/)
-   -   XmlTextWriter and XmlTextReader causes me an error (http://www.go4expert.com/forums/xmltextwriter-xmltextreader-causes-error-t4553/)

KFO 5Jun2007 11:25

XmlTextWriter and XmlTextReader causes me an error
 
The process cannot access the file 'D:\file.xml' because it is being used by another process.

This is the error i get because i started with Reading the file.xml and then i write it again in the same class using XmlTextWriter and XmlTextReader.
my objective here is to read xml file to process it and provide the user a flexability to edit this xml file and then i rewrite it. However this error is keep coming up to me. I am writing a console and a windows application
any advice?
Thanks

shabbir 5Jun2007 12:26

Re: XmlTextWriter and XmlTextReader causes me an error
 
2 things

XmlTextWriter and XmlTextReader helps in appending and not editing for that you need to use XMLDocument.

Also regarding the error it looks you are not closing the XML file after reading.


All times are GMT +5.5. The time now is 01:21.