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. Visual Basic
  4. Accessing an XML sequence

Accessing an XML sequence

Scheduled Pinned Locked Moved Visual Basic
csharpxmlquestion
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.
  • B Offline
    B Offline
    Bernhard Hofmann
    wrote on last edited by
    #1

    Hi I'm trying to access a sequence which is part of a node in an XML file. <property pr_ref="ABC" ... > <sellingpoint text="HALLWAY" /> <sellingpoint text="DINING ROOM" /> <sellingpoint text="KITCHEN" /> </property> I can iterate through the "property" nodes and retrieve their columns (pr_ref) but how on earth do I access the sequence of selling points? I've tried childrows and parents rows and I'm lost! I'm using VB.NET and I have the entire file in a DataSet. The second table of the dataset seems to contain ALL of the sellingpoint rows, not just those related to the one property.:confused: I'm desperate! Bernhard Don't worry, nobody lives forever.

    M 1 Reply Last reply
    0
    • B Bernhard Hofmann

      Hi I'm trying to access a sequence which is part of a node in an XML file. <property pr_ref="ABC" ... > <sellingpoint text="HALLWAY" /> <sellingpoint text="DINING ROOM" /> <sellingpoint text="KITCHEN" /> </property> I can iterate through the "property" nodes and retrieve their columns (pr_ref) but how on earth do I access the sequence of selling points? I've tried childrows and parents rows and I'm lost! I'm using VB.NET and I have the entire file in a DataSet. The second table of the dataset seems to contain ALL of the sellingpoint rows, not just those related to the one property.:confused: I'm desperate! Bernhard Don't worry, nobody lives forever.

      M Offline
      M Offline
      Matt Casto
      wrote on last edited by
      #2

      The DataSet will load the different levels of nodes into seperate tables, but will create relationships between those tables for you. The property table that is created in the DataSet should have a relationship to the sellingpoint table, which could be accessed through the DataSet.Tables(0).ChildRelations collection. Using this DataRelation, you can access the sellingpoint children of a property row by doing DataSet.Tables(0).Rows(0).GetChildRows(DataRelation). There are other ways to do this as well. Just take a look at the help for DataSet and DataTable for more information. Or, to get an idea of exactly what is in your DataSet after loading the XML, set a breakpoint in your code, and do a QuickWatch (right click on an object after breaking into code during debug of your application) of your DataSet.

      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