Click here to Skip to main content
16,004,860 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: bug in XmlReader ? Pin
Guffa6-Oct-06 12:18
Guffa6-Oct-06 12:18 
GeneralRe: bug in XmlReader ? Pin
Chris Losinger6-Oct-06 12:31
professionalChris Losinger6-Oct-06 12:31 
GeneralRe: bug in XmlReader ? Pin
Guffa6-Oct-06 13:17
Guffa6-Oct-06 13:17 
GeneralRe: bug in XmlReader ? Pin
Chris Losinger6-Oct-06 16:42
professionalChris Losinger6-Oct-06 16:42 
GeneralRe: bug in XmlReader ? Pin
Guffa7-Oct-06 1:47
Guffa7-Oct-06 1:47 
GeneralRe: bug in XmlReader ? Pin
Chris Losinger7-Oct-06 3:50
professionalChris Losinger7-Oct-06 3:50 
GeneralRe: bug in XmlReader ? Pin
Colin Angus Mackay10-Oct-06 1:05
Colin Angus Mackay10-Oct-06 1:05 
AnswerRe: bug in XmlReader ? [modified] Pin
Dave Kreskowiak6-Oct-06 4:39
mveDave Kreskowiak6-Oct-06 4:39 
Your right about the class being poorly documented. It's not a bug with the class, but with the people who wrote it.

In the XmlReader class, there is, thankfully, a property called ReadState that you can check in your code to see if the was actually opened or not. The possible values are Closed, EndOfFile, Error, Initial, and Interactive. Docs on it are here[^].

You can either use Guffa's version or just call the Dispose() method on the XmlReader in your catch block. If the file hasn't been opened, nothing will happen if you call Dispose on the reader.



-- modified at 10:56 Friday 6th October, 2006

Changed Close to Dispose. That's what I get for spending entire day and night writing in VBScript...


Dave Kreskowiak
Microsoft MVP - Visual Basic


GeneralRe: bug in XmlReader ? Pin
Chris Losinger6-Oct-06 4:55
professionalChris Losinger6-Oct-06 4:55 
QuestionConvert a collection into a list?? Pin
roxuca5-Oct-06 4:39
roxuca5-Oct-06 4:39 
AnswerRe: Convert a collection into a list?? Pin
Robert Rohde9-Oct-06 22:33
Robert Rohde9-Oct-06 22:33 
QuestionComplier Error Question Pin
Beringer5-Oct-06 3:42
Beringer5-Oct-06 3:42 
AnswerRe: Complier Error Question Pin
mr_lasseter5-Oct-06 4:48
mr_lasseter5-Oct-06 4:48 
QuestionAutomatic copying of dlls Pin
Seshadri Manivannan4-Oct-06 2:49
Seshadri Manivannan4-Oct-06 2:49 
AnswerRe: Automatic copying of dlls Pin
Dave Kreskowiak4-Oct-06 4:49
mveDave Kreskowiak4-Oct-06 4:49 
QuestionSystem.IO.FileNotFoundException: The specified module could not be found. Pin
Elena_2006oct4-Oct-06 2:47
Elena_2006oct4-Oct-06 2:47 
AnswerRe: System.IO.FileNotFoundException: The specified module could not be found. Pin
S. Senthil Kumar6-Oct-06 6:13
S. Senthil Kumar6-Oct-06 6:13 
GeneralRe: System.IO.FileNotFoundException: The specified module could not be found. Pin
Elena_2006oct6-Oct-06 6:43
Elena_2006oct6-Oct-06 6:43 
GeneralRe: System.IO.FileNotFoundException: The specified module could not be found. Pin
S. Senthil Kumar6-Oct-06 19:03
S. Senthil Kumar6-Oct-06 19:03 
GeneralRe: System.IO.FileNotFoundException: The specified module could not be found. Pin
Elena_2006oct8-Oct-06 22:13
Elena_2006oct8-Oct-06 22:13 
QuestionIE popup Pin
m_mor4-Oct-06 0:31
m_mor4-Oct-06 0:31 
AnswerRe: IE popup Pin
CWIZO4-Oct-06 19:58
CWIZO4-Oct-06 19:58 
QuestionExclude labes from versions (VSS API) Pin
CWIZO3-Oct-06 20:08
CWIZO3-Oct-06 20:08 
QuestionCount a process network traffic Pin
Oleg Savelos3-Oct-06 9:38
Oleg Savelos3-Oct-06 9:38 
AnswerRe: Count a process network traffic Pin
Dave Kreskowiak3-Oct-06 10:13
mveDave Kreskowiak3-Oct-06 10:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.