473,406 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

XML Reader

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
3 1479
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
"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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Stephan | last post by:
I'm fairly new to python and am working on parsing some delimited text files. I noticed that there's a nice CSV reading/writing module included in the libraries. My data files however, are odd...
8
by: Todd Bright | last post by:
Is there a way to get the current XmlNode from the reader while in the validation event handler? What I'd like to do is display the error message along with the name of its parent node. In my...
1
by: Anand | last post by:
I just implemented a program to solve reader writter prob. Wenever I run the program it seems to go into S+ state and it waits there I dont know why. When i attach gdb to one of the childs and step...
1
by: Aaron | last post by:
I asked for a script that can read info inside a specific xml tag and someone gave me this example. XmlReader reader = new XmlTextReader( filename ); while ( reader.Read() ) { if (...
12
by: Jerry Camel | last post by:
Not sure if this is a good place to post this... I'm writing and ASP.net app using vb .net. I need to interact with a credit card reader. I have one that sits inline with the keyboard. Works...
6
by: Karl Seguin [MVP] | last post by:
The BinaryWriter/Reader's are little-endian only. Was hoping they were going to be made more flexible in 2.0, but that doesn't appear to be the case. Anyone already done all the work of...
5
by: Dylan Parry | last post by:
Hi, At the moment I use code like the following: string myString = this.dataReader.IsDBNull(2) ? null : this.dataReader.GetString(2); With a record from the DB that looks like: ...
1
by: vbDavidC | last post by:
Hi, I am fairly new to .net and objects. I learned to create a reader object in method 1, however if I wanted to create multiple select queries in the same module I did not know how to reuse...
6
by: dgleeson3 | last post by:
Hello All I have VB code (.Net 2005) reading from an SQL server 2005 database. Im getting InvalidCastException when doing reader.GetInt32(0) Im simply reading an int from a simple database. It...
0
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post by:
Hi all people, everybody, We have multiple versions of Acrobat Reader from 5.x to 8.x, I want to create a method in C# or VB.NET to check to see if the registry key for the versions...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.