Combine multiple sources into one dataset

Posted on 2005-05-17
Medium Priority
Last Modified: 2012-05-05
I'm creating a sub routine that will be writing a flat, one row XML file to disk. No relations or parent/child stuff to worry about. There will be a number of different sources for values to be written - a couple different sprocs, as well as local values, Session and Request vars.

This is my first foray into the XML writer and I've reviewed a couple tutorials that are pointing me in the direction of using a DataSet as the source to output the XML from. My thinking at this point is that I'll build the Dataset from the various sources and then dump that to the xml writer.

Given that outline/overview of my intents I'd like to either be re-directed to a different stratagy or pointed to a tutorial or sample code that demonstrates the manual construction of a dataset from a variety of sources.

Question by:juststeve
  • 2
LVL 96

Accepted Solution

Bob Learned earned 1000 total points
ID: 14017878
Start with some sample VB code:

    Dim ds As New DataSet

    Dim dt As New DataTable("Table")

    dt.Columns.Add(New DataColumn("Column1", GetType(String)))
    dt.Columns.Add(New DataColumn("Column2", GetType(Integer)))
    dt.Columns.Add(New DataColumn("Column3", GetType(Boolean)))



Author Comment

ID: 14018125
Ok...and inserting the values themselves looks to be as simple as:

    dt.Rows.Add(new Object() {Session("this_a_String"), dsDifferentOneFromSproc("ID"), TRUE)

LVL 96

Expert Comment

by:Bob Learned
ID: 14018165
Try this instead:

Dim dr As DataRow = dt.NewRow

dr("Column1") = Session("this_a_String")
dr("Column2") = dsDifferentOneFromSproc("ID")
dr("Column3") = True



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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

850 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