Hi,
I am trying to use the XMLTextReader's Read(), I get an exception always, saying that file is being used by another process.. I know not where is that being used..
Any thoughts...
Hi,
I am trying to use the XMLTextReader's Read(), I get an exception always, saying that file is being used by another process.. I know not where is that being used..
Any thoughts...
XMLTextReader
AmolWankhede
Hello,
Thank you all for the responses, I will try and let you know..
Forseti
Do you only need to display different values from this xml file in some controls
Then, it is absoletly not necessary to use 3 xmlreaders to read this xml file. You can also work with XmlDocument and Xpath to retrieve the values.
However, I do not know what you precisely want.
Matthew Adams9346
Create a FileStream for the XML file that you want to read. Use the 4 argument constructor of FileStream; the one that lets you allow the FileShare parameter, and set this parameter to FileShare.Read.
FileStream fs = new FileStream (@"c:\directory\myxmlfile.xml", FileMode.Open, FileAccess.Read, FileShare.Read);
Then, you can use this FileStream as an argument in the constructor of the xml reader:
XmlTextReader myReader = new XmlTextReader (fs);
MariaW
Thats lovely Frederick..
I am not sure if I will be in trouble again.. For 1 control I have to use the filename, other I am parsing so fs will do.. yet for another I do not know how the design will be..
Is there an easy deal to syncronize, so that I will be able to see the changes..
hessie
Hi friends,
The root cause of the problem mentioned above was with one of the custom control that does not allow to share by default, setting it allows me to pass the same file name to three of the controls.
Thanks again!! for all your thoughts..
But some queries posted above remains..
Thanks for the reply, XmlDocument is not as handy as XmlTextReader, in XmlTextReader there are many properties available to check conditions and get details.. Its hard to trace in XmlDocument class.. Any best pointers can help me.. Basically need to know more abt XmlDocument.
Using XmlTextReader and/or XmlDocument is it possible to get the total rowcount of element and text count present in Xml file In other words I need to know the total elements and text present..
Glad to see any info on this..
sameera
Hello,
Would you like to use same connection object for XML file
When 1st control has done with connection object than use connection for 2nd control etc.
If you want to use it in same time. Use threads.. I hope my words are helpful to you.
Happy coding...
IanGilroy
Benjamin00
Hi,
Sorry, the dealings are basic, to be a massive implementation...
P.J.Ganesh
Use something like this to load it from the string.
XmlTextReader objReader=new XmlTextReader(new StringReader(sXML));
keby
hi,
i guess the time had come to show up some code to see whats wrong
best regards
Dean Forant
Hi Frederick,
I am getting the same exception (Used by another process) when writing xml.. I know not why...
Any Ideas...
Shyne79
Hello,
I just figured it out.. I am using 3 controls to display the same file in different formats... Now I was trying to load in 2 controls and therefore I got this exception..
Anyway I need to load the same in the 3 controls...
Any techniques..
Henry Hahn - MSFT
Hi Frederik,
Thanks for the reply, XmlDocument is not so handy to use as XmlTextReader, here there are many properties available to check conditions and get details.. Its hard to trace in XmlDocument class.. Any best pointers can help me..
Using XmlTextReader is it possible to get the total rowcount/ element count present in Xml file
Desmond Molins