Hi,
Whats wrong with my code?
XmlTextReader textReader = new XmlTextReader(@"D:\xml_file.xml");
textReader.Read();
// If the node has value
while (textReader.Read())
{
// Move to fist element
textReader.MoveToElement();
Console.WriteLine("XmlTextReader Properties Test");
Console.WriteLine("===================");
// Read this element's properties and display them on console
Console.WriteLine("id:" + textReader.id.ToString());
Console.WriteLine("name:" + textReader.name.ToString());
Console.WriteLine("time:" + textReader.time.ToString());
}
Console.ReadLine()
show erron on: id, name, time
My XML file:
<students>
<student>
<id>1</id>
<name>Rikko Nora</name>
<time>2010-03-12</time>
</student>
<student>
<id>2</id>
<name>Rikko Nora2</name>
<time>2010-05-15</time>
</student>
</students>