473,386 Members | 1,864 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,386 software developers and data experts.

Error recovery when using XMLWriter

Hi All,

I'm writing data into an XmlTextWritter and I want to able to recover from
an error if it occurs and continue the writing. So far even though I trap
the error any subsequent attempt to write to it, it raises yet another
exception because the writer is in an error state.

Is there a way to reset the WriteState so I can continue writing?

Thanks in advance,
Greg.
Jan 19 '07 #1
1 3928
greg wrote:
I'm writing data into an XmlTextWritter and I want to able to recover from
an error if it occurs and continue the writing. So far even though I trap
the error any subsequent attempt to write to it, it raises yet another
exception because the writer is in an error state.

Is there a way to reset the WriteState so I can continue writing?
The documentation
<http://msdn2.microsoft.com/en-us/library/system.xml.writestate.aspx>
suggests that all you can do in an error state is close the reader,
other operations are not possible but throw an InvalidOperationException.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jan 19 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John Rajendran | last post by:
Hi there, I am trying to use the XMLWriter for writing back the XML data into an XML file which is in the same folder as ASPX file. I am having problems when I write a Dataset from ASPX page to the...
10
by: xixi | last post by:
i have db2 udb v8.1 on windows 64 bit 2003 server, after db2 server start , i found this in the db2diag.log, is this error? 2004-05-05-15.28.30.780000 Instance:DB2 Node:000...
1
by: Vannela | last post by:
I am creating a xml file parsing a PB .srd file. It is executing properly but the error is "MISSING ROOT ELEMENT" the code is: sring dw_parts=null; FileStream fs = File.Open("C:\\Documents...
2
by: FrzzMan | last post by:
The first time I called this function, everything went well, but the second time I called it. An Exception thrown, do you know why? An unhandled exception of type 'System.IO.IOException' occurred...
3
by: Raed Sawalha | last post by:
Hello when I serialize an object an error generated using this function public string SerializeObject(object oClassObject,System.Type oClassType) { XmlSerializer oSerializer = new...
5
by: igotyourdotnet | last post by:
I'm creating a web service this is going to return an arraylist of items. When I try and run it Im' getting the following error message: System.InvalidOperationException: There was an error...
0
by: Janusz Nykiel | last post by:
I've stumbled upon unexpected behavior of the .NET 2.0 System.Xml.XmlWriter class when using it to write data to a binary stream (System.IO.Stream). If the amount of data is less than a certain...
9
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have a .net application and am using the xml writer class to create an xml file that opens as an excel file. I am trying to write out the following but am having difficulty. <Row> <Cell...
0
by: pavankumarveera | last post by:
how to unblock the CF below error what was the solution. GES: Potential blocker (pid=282) on resource CF-00000000-00000000; enqueue info in file...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.