XML Reader

  • Thread starter Thread starter google_groups3
  • Start date Start date
G

google_groups3

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
 
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?
 
Scott M. said:
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.
 
Scott M. said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top