Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Read XML using XmlTextReader

Read XML using XmlTextReader

Scheduled Pinned Locked Moved XML / XSL
csharpxmlhelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jammmie999
    wrote on last edited by
    #1

    Hi, I am beginning using XML. I can write to XML ok but I am having problems reading it in C#. What have I done wrong and how can I fix it. My code XmlReader Reader = new XmlTextReader(Property.Settings.Default.XML_Location); while (Reader.Read()) { if (Reader.Name == "Finished")); { listbox1.Items.Add(Reader.Name + " : " + Reader.Value); } } My XML page Thanks

    L 1 Reply Last reply
    0
    • J jammmie999

      Hi, I am beginning using XML. I can write to XML ok but I am having problems reading it in C#. What have I done wrong and how can I fix it. My code XmlReader Reader = new XmlTextReader(Property.Settings.Default.XML_Location); while (Reader.Read()) { if (Reader.Name == "Finished")); { listbox1.Items.Add(Reader.Name + " : " + Reader.Value); } } My XML page Thanks

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      I don't know what your current problem is because you did not state what it was. However using == in an object oriented system is not best practice. See string.Equals() Secondly, "Finished" is NOT EQUAL to "finished".

      jammmie999 wrote:

      if (Reader.Name == "Finished"));

      jammmie999 wrote:

      finished="True" />

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups