Using XMLTextReader

K

kp

Hi,

I'm using XMLTextReader to read from a file. As I loop
through the reader, I check a condition (see below).

While reader.Read()
If (reader.Name = "Test"
And (reader.NodeType = XmlNodeType.Element)) Then
PopulatePatientList(reader)
End If
End While

The watches I've added show that the node will change
prematurely (i.e., just stepping thru line-by-line moves
the reader to the next node). In other words, it doesn't
wait to the While command to change nodes.

WHHHHHYYYYYYYYYYYYYYY WONT IT BEHAAAVE!!???!!!!!!!!!!!!!!

Please help.
 

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

Top