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. XML help please - never worked with this structure before

XML help please - never worked with this structure before

Scheduled Pinned Locked Moved Visual Basic
questioncsharpxmloop
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.
  • P Offline
    P Offline
    penguin5000
    wrote on last edited by
    #1

    Hello, I've been given a sample XML file in a structure that I haven't handled in VB.NET before and would appreciate some guidance. The structure is as follows: <Interface CompanyCode="COMP01" CreatedOn="2007-05-27T10:20:00" CreatedBy="PRODUCT" CreatorKey="PROD" SequenceNo="1" CreatorReference="NEWPRODUCT"> <Product ProductCode="P1"> <Description>Product 1 Description</Description> </Product> <Product ProductCode="P2"> <Description>Product 2 Description</Description> <Value EffectiveDate="2006-04-01"> <Price>5.50</Price> <Currency>GB</Currency> </Value> </Product> <Product ProductCode="P3"> <Description>Product 3 Description</Description> </Product> </Interface> When I read the xml file in with ... Dim ds As DataSet = New DataSet("dataset") ds.ReadXml("prod2.xml") With DataGridView1 .DataSource = ds .DataMember = ds.Tables(2).TableName End With ... I can see that I've got 3 x tables ... "Interface", "Product", "Value". What I'm wondering is how do I get the "Value" table linked to "Product"? I was expecting (rightly or wrongly) to see some inherited values from product displayed in my DataGridView. Looking at the structure of the XML file, it seems to imply that there should be some inheritance???

    J 1 Reply Last reply
    0
    • P penguin5000

      Hello, I've been given a sample XML file in a structure that I haven't handled in VB.NET before and would appreciate some guidance. The structure is as follows: <Interface CompanyCode="COMP01" CreatedOn="2007-05-27T10:20:00" CreatedBy="PRODUCT" CreatorKey="PROD" SequenceNo="1" CreatorReference="NEWPRODUCT"> <Product ProductCode="P1"> <Description>Product 1 Description</Description> </Product> <Product ProductCode="P2"> <Description>Product 2 Description</Description> <Value EffectiveDate="2006-04-01"> <Price>5.50</Price> <Currency>GB</Currency> </Value> </Product> <Product ProductCode="P3"> <Description>Product 3 Description</Description> </Product> </Interface> When I read the xml file in with ... Dim ds As DataSet = New DataSet("dataset") ds.ReadXml("prod2.xml") With DataGridView1 .DataSource = ds .DataMember = ds.Tables(2).TableName End With ... I can see that I've got 3 x tables ... "Interface", "Product", "Value". What I'm wondering is how do I get the "Value" table linked to "Product"? I was expecting (rightly or wrongly) to see some inherited values from product displayed in my DataGridView. Looking at the structure of the XML file, it seems to imply that there should be some inheritance???

      J Offline
      J Offline
      Johan Hakkesteegt
      wrote on last edited by
      #2

      By the look of things, the table Value is already linked to Product, the problem is just that this example only contains data (price, currency, etc) for Product 2.

      My advice is free, and you may get what you paid for.

      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