When I try to do the following in a vb.net application:
[code=vbnet]While xtr.Read() And recordCnt < loopCount
If xtr.NodeType = XmlNodeType.Ele ment Then
If (xtr.Name = "Employee") Then
recordCnt = recordCnt + 1
strWriter = New StringWriter
UID = ""
strWriter.Write (xtr.ReadOuterX ml)
Dim xdoc As New XmlDocument
'writeObj = CreateObject("M SXML2.DOMDocume nt")
If docType = "devplan" Then
xdoc.LoadXml("< ?xml version=""1.0"" encoding=""utf-16"" ?><Batch><Devel opmentPlan>" & strWriter.ToStr ing & "</DevelopmentPlan ></Batch>")
Else
xdoc.LoadXml("< ?xml version=""1.0"" encoding=""utf-16"" ?><Batch><Talen tProfile>" & strWriter.ToStr ing & "</TalentProfile></Batch>")
End If
End While[/code]
Every other record seems to get skipped when I try to use readouterxml within the while read() loop. Any ideas why this happening or what I can do to fix this issue?
Thanks.
[code=vbnet]While xtr.Read() And recordCnt < loopCount
If xtr.NodeType = XmlNodeType.Ele ment Then
If (xtr.Name = "Employee") Then
recordCnt = recordCnt + 1
strWriter = New StringWriter
UID = ""
strWriter.Write (xtr.ReadOuterX ml)
Dim xdoc As New XmlDocument
'writeObj = CreateObject("M SXML2.DOMDocume nt")
If docType = "devplan" Then
xdoc.LoadXml("< ?xml version=""1.0"" encoding=""utf-16"" ?><Batch><Devel opmentPlan>" & strWriter.ToStr ing & "</DevelopmentPlan ></Batch>")
Else
xdoc.LoadXml("< ?xml version=""1.0"" encoding=""utf-16"" ?><Batch><Talen tProfile>" & strWriter.ToStr ing & "</TalentProfile></Batch>")
End If
End While[/code]
Every other record seems to get skipped when I try to use readouterxml within the while read() loop. Any ideas why this happening or what I can do to fix this issue?
Thanks.
Comment