Solved

Reding xml object in to a dataset

Posted on 2004-09-14
3
171 Views
Last Modified: 2007-09-28
I have an xml data coming back to me in the form of a object. I need this xml data to be read in to the dataset. How can I read an object data in to a dataset using vb.net. Its very urgent
0
Comment
Question by:angireddy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Accepted Solution

by:
Clif earned 500 total points
ID: 12056222
       Dim sXML As String
        Dim xTest As New Xml.XmlDocument

        sXML = "<dataroot>"
        sXML += "<record>"
        sXML += "<column1>"
        sXML += "Column 1a"
        sXML += "</column1>"
        sXML += "<column2>"
        sXML += "Column 2a"
        sXML += "</column2>"
        sXML += "<column3>"
        sXML += "Column 3a"
        sXML += "</column3>"
        sXML += "</record>"
        sXML += "<record>"
        sXML += "<column1>"
        sXML += "Column 1b"
        sXML += "</column1>"
        sXML += "<column2>"
        sXML += "Column 2b"
        sXML += "</column2>"
        sXML += "<column3>"
        sXML += "Column 3b"
        sXML += "</column3>"
        sXML += "</record>"
        sXML += "</dataroot>"

        xTest.LoadXml(sXML)

        Dim xmlTest As New XmlDocument
        xmlTest.LoadXml(sXML)
        Dim ds As New DataSet
        Dim reader As New XmlNodeReader(xmlTest)
        ds.ReadXml(reader)
        reader.Close()
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question