Results 1 to 2 of 2

Thread: Xml And Treeview

  1. #1

    Thread Starter
    Fanatic Member carlblanchard's Avatar
    Join Date
    Sep 2003
    Location
    Bournemouth (UK)
    Posts
    539

    Xml And Treeview

    hI ALL

    ok ive got my database returning a record set in the form of xml
    it basically uses the Microsoft data access block to return a dataset as xml......

    i now what to filter all the records from the xml and stick them into my treeview (i can do the adding to treeview bit, however every charicter is a node)

    so my question is "HOW DO I TURN MY XML INTO JUST VALUES WITHOUT ALL THE CRAP SHOWN BELOW"

    current============================
    <NewDataSet>
    <Table>
    <fullname>Carl Blanchard</fullname>
    </Table>
    <Table>
    <fullname>Richard Dobson</fullname>
    </Table>
    <Table>
    <fullname>Richard Dobson</fullname>
    </Table>
    </NewDataSet>

    would like============================
    Carl Blanchard
    Richard Dobson
    Richard Dobson

    code examples are fully welcome
    I am curretly building a defect management system for software and web developers,
    If you wana try it out (beta test) and keep it for free just send me a message

  2. #2
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724
    It's in C#, but easily converted to VB.Net:
    Code:
    // Where xmlResults is a XmlDocument.
    XmlNodeList fullNameNodes = xmlResults.SelectNodes("NewDataSet/Table/fullname");
    foreach (XmlNode fullNameNode in fullNameNodes)
    {
        string fullName = fullNameNode.InnerText;
        System.Diagnostics.Debug.WriteLine(fullName);
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width