Tech
Forums
Jobs
Books
Events
Live
Interviews Prep
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
c# Reading XML nodes with spaces.
Chris Johnson
Apr 7 2016 8:15 AM
382
Reply
Hello all. This will be easy for someone. I am attempting to write a little program to read incoming reports from a customer.
while (reader.Read())
{
switch (reader.NodeType)
{
case XmlNodeType.Element: // The node is an element.
settings.IgnoreWhitespace = true;
if (reader.Name == "vShipperNumber Text")
{
MessageBox.Show(reader.Name + " " + reader.Value);
}
break;
}
}
and a small piece of the XML looks like this.
-<Row2>
<vShipperNumber Text="71370001"/>
</Row2>
So I get back vShipperNumber from the code because of the space and never get the value "71370001". Could someone please tell me what I am doing wrong? Please be aware I have never worked with XML before and I really have not yet understood the structure.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
how to send message
Gridview RadioButton is not working after publishing my app