Results 1 to 3 of 3

Thread: [RESOLVED][2005] need help upon reading my xml file

  1. #1

    Thread Starter
    Hyperactive Member shyguyjeff's Avatar
    Join Date
    Jul 2007
    Location
    City of Durian
    Posts
    289

    Resolved [RESOLVED][2005] need help upon reading my xml file

    Elow everyone have a nice day...Could anyone of you help me how to read my xml and put it into a string. Below is my xmlfile and I want to call it to my code.

    Code:
    <?xml version="1.0" standalone="yes"?>
      <Server>
        <name>CARCAR</name>
      </Server>

    I want it to read it and put it into a string inside my code so that i can call it anytime. Could anyone help me this things? Thanks in advance guys.
    Last edited by shyguyjeff; May 4th, 2008 at 10:37 PM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] need help upon reading my xml file

    vb.net Code:
    1. Dim reader As XmlReader = XmlReader.Create("file path here")
    2.  
    3. reader.Read()
    4. reader.ReadStartElement("Server")
    5. reader.ReadStartElement("name")
    6. MessageBox.Show(reader.ReadString())
    7. reader.ReadEndElement()
    8. reader.ReadEndElement()
    9. reader.Close()
    I suggest you read a bit about the XmlReader class. If you want to edit XML documents then you should read about the XmlDocument class too, and the XmlWriter class for good measure.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Hyperactive Member shyguyjeff's Avatar
    Join Date
    Jul 2007
    Location
    City of Durian
    Posts
    289

    Re: [2005] need help upon reading my xml file

    tnx...jmcilhinney...i will try also to read all about xml at msdn..a million thanks to you jm..God Bless and have a nice day!

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