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 file

xml file

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

    I Had an xml file that had a table in it.table0 I have recently added another. table1. now when I run my program it says there are multiple root elements Line 10,position 2. does this mean i need to use SQL. if so or if not can someone type some sample code that would stop the root element problem. If you need to see my code I have another thread posted under datagrid/xmlfile that i posted yesterday and is on the next page.

    T 1 Reply Last reply
    0
    • M Makniteasy

      I Had an xml file that had a table in it.table0 I have recently added another. table1. now when I run my program it says there are multiple root elements Line 10,position 2. does this mean i need to use SQL. if so or if not can someone type some sample code that would stop the root element problem. If you need to see my code I have another thread posted under datagrid/xmlfile that i posted yesterday and is on the next page.

      T Offline
      T Offline
      Tom John
      wrote on last edited by
      #2

      The clue is in the error... i am guessing your original file was something like this:

      <Table>
      <FirstElement/>
      <SecondElement/>
      ...
      <LastElement/>
      </Table>

      Now i am guessing that you have a second table it looks something like this:

      <Table>
      <FirstElement/>
      <SecondElement/>
      ...
      <LastElement/>
      </Table>
      <Table>
      <FirstElement/>
      <SecondElement/>
      ...
      <LastElement/>
      </Table>

      The problem is the two Table nodes in the root, therefore you need to put in a single root element:

      <Tables>
      <Table>
      <FirstElement/>
      <SecondElement/>
      ...
      <LastElement/>
      </Table>
      <Table>
      <FirstElement/>
      <SecondElement/>
      ...
      <LastElement/>
      </Table>
      </Tables>

      Hope this helps Tom

      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