creating dataset from datarowcollection

M

Matt Tapia

I have a datarow collection (drAccountInfo), and I want to add each row to a
datatable that is then added to a dataset...here is my code:

Dim iCount As Integer
Dim myDataTable As New DataTable

For iCount = 0 to drAccountInfo.Length-1
Trace.Warn(iCount)
myDataTable.ImportRow(drAccountInfo(iCount))
Next iCount

Dim myDataSet As New DataSet
myDataSet.Tables.Add(myDataTable)
myDataSet.WriteXML("C:\inetpub\wwwroot\myapp\myfile.xml")

Everytime I run it, I get a blank dataset, but I know there is data in the
datarow collection. What gives?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top