2 Replies - 2272 Views - Last Post: 12 April 2012 - 09:17 AM Rate Topic: -----

#1 mahaveersharma  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 07-July 10

how to get data from xml file to vb.net 2008

Posted 12 April 2012 - 02:56 AM

hi there i have this xml file. and in my vn form i have five labels. i want to get records from this xml file to my vb.net2008 application. i want to set question on first label and choices on other four labels how to do that

<?xml version="1.0" encoding="UTF-8"?>
<Title>Who wants to be a Millionaire?</Title>
<Random>yes</Random>
<AllQuestions>
<Q>
<question>What phrase is used to describe words that are written without the use of captal letters?</question>
<answer>2</answer>
<choice_1>Lower rucksack</choice_1>
<choice_2>Lower case</choice_2>
<choice_3>Lower bag</choice_3>
<choice_4>Lower holdall</choice_4>
</Q>
<Q>
<question>What is someone having done if they are asked to "watch the birdie"? </question>
<answer>3</answer>
<choice_1>Blood test</choice_1>
<choice_2>Haircut</choice_2>
<choice_3>Photograph taken</choice_3>
<choice_4>Pedicure</choice_4>
</Q>
<Q>
<question>Which is of these is a bird of the Crow family noted for its thieving habits?</question>
<answer>4</answer>
<choice_1>Jimdaw</choice_1>
<choice_2>Johndaw</choice_2>
<choice_3>Jockdaw</choice_3>
<choice_4>Jackdaw</choice_4>
</Q>
</AllQuestions>



Imports System.Xml
Imports System.IO
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        
        
    End Sub
End Class



Is This A Good Question/Topic? 0
  • +

Replies To: how to get data from xml file to vb.net 2008

#2 deery5000  Icon User is offline

  • D.I.C Addict

Reputation: 78
  • View blog
  • Posts: 966
  • Joined: 09-May 09

Re: how to get data from xml file to vb.net 2008

Posted 12 April 2012 - 05:34 AM

Have you had a look at Ling to xml

its a great method for finding nodes within an xml file and extracting the information you require.

there is tons of examples on the internet, google is your frind :)

Hope this helps
Kevin
Was This Post Helpful? 1
  • +
  • -

#3 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2255
  • View blog
  • Posts: 9,444
  • Joined: 29-May 08

Re: how to get data from xml file to vb.net 2008

Posted 12 April 2012 - 09:17 AM

Here is a link to a tutorial, demonstrating what deery5000 is saying.
My link
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1