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. C#
  4. C# navigating to top of page

C# navigating to top of page

Scheduled Pinned Locked Moved C#
csharpalgorithmsxmlhelpquestion
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.
  • N Offline
    N Offline
    nyjcr
    wrote on last edited by
    #1

    Hello, I'm trying to navigate from the middle of the xml page back to the top(to the parent node). So I can perform another search looking for matches to my random number,

    while (xmlReader.Read()) //while loop to verify the new number is unique
    {

                    xmlReader.MoveToElement();
                    TempNo = xmlReader.Value;
                    if (tempNo == Convert.ToString(userID))
                    {
                        //if already exist, create new one
                        UserID = RadNo.Next(10, 99); //Random number
                        
                        //At this point I want to start searching again
                        //Move to the top of the parent node (1st node on page)
                        //and search all nodes again.
                    }
                }
    

    The above is my code, hope this help. Sorry if this is a simple question, I'm totally new to xml and c# just learning it really... -JC

    N 1 Reply Last reply
    0
    • N nyjcr

      Hello, I'm trying to navigate from the middle of the xml page back to the top(to the parent node). So I can perform another search looking for matches to my random number,

      while (xmlReader.Read()) //while loop to verify the new number is unique
      {

                      xmlReader.MoveToElement();
                      TempNo = xmlReader.Value;
                      if (tempNo == Convert.ToString(userID))
                      {
                          //if already exist, create new one
                          UserID = RadNo.Next(10, 99); //Random number
                          
                          //At this point I want to start searching again
                          //Move to the top of the parent node (1st node on page)
                          //and search all nodes again.
                      }
                  }
      

      The above is my code, hope this help. Sorry if this is a simple question, I'm totally new to xml and c# just learning it really... -JC

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      XMLReader is forward only. Use XMLDocument class instead and use XPath to do your search.

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

      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