By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,343 Members | 925 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,343 IT Pros & Developers. It's quick & easy.

XML Reader

P: n/a
BuildXML = New System.Xml.XmlTextWriter(Application.StartupPath &
"\data.xml", Nothing)

The above command gives me the error:

"An unhandled exception of type 'System.IO.IOException' occurred in
mscorlib.dll"

"Additional information: The process cannot access the file
"S:\bin\data.xml" because it is being used by another process."

Any ideas why?
P.S. In the form load event, it uses the same command but for a
different XML file to read in some info. But if i comment this line
out, I still get the above error.

TIA
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
It is pretty clear from the message, that something else is using the
data.xml file. Were you using it somewhere else in code and didn't close
the object used to read it?
<go************@hotmail.com> wrote in message
news:3e*************************@posting.google.co m...
BuildXML = New System.Xml.XmlTextWriter(Application.StartupPath &
"\data.xml", Nothing)

The above command gives me the error:

"An unhandled exception of type 'System.IO.IOException' occurred in
mscorlib.dll"

"Additional information: The process cannot access the file
"S:\bin\data.xml" because it is being used by another process."

Any ideas why?
P.S. In the form load event, it uses the same command but for a
different XML file to read in some info. But if i comment this line
out, I still get the above error.

TIA

Nov 21 '05 #2

P: n/a
"Scott M." <s-***@nospam.nospam> wrote in message news:<e$**************@TK2MSFTNGP12.phx.gbl>...
It is pretty clear from the message, that something else is using the
data.xml file. Were you using it somewhere else in code and didn't close
the object used to read it?


Thanks, I solved it. I was using a directory walker function that
called itself and I had left the statement in that function. I moved
the statement to the Declarations area and it worked fine.

Thanks for your help though.
Nov 21 '05 #3

P: n/a
"Scott M." <s-***@nospam.nospam> wrote in message news:<e$**************@TK2MSFTNGP12.phx.gbl>...
It is pretty clear from the message, that something else is using the
data.xml file. Were you using it somewhere else in code and didn't close
the object used to read it?


Thanks, I solved it. I was using a directory walker function that
called itself and I had left the statement in that function. I moved
the statement to the Declarations area and it worked fine.

Thanks for your help though.
Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.