populate many xml file into single dataset

N

naruphon

I wanted to read two differrent xml files and put into the same dataset but
having different table names. I found most of example showing the 'fill'
method in dataadapter but no xml file. I will finally create the
relationship for joining two tables togeter. Can anyone here help me to
modify the code to allow to read the second xml file to the dataset?

Thanks,
Naruphon

using System;

using System.IO;

using System.Data;

class TestXML{

public static void Main(){


StreamReader rd = File.OpenText("Project.xml");

DataSet ds = new DataSet("Project");

ds.ReadXml(rd);

rd.Close();


// I need to load the job.xml here.

foreach(DataRow drProject in ds.Tables["Project"].Rows)

{

Console.WriteLine("{0}{1}",drProject["id"],drProject["Name"]);

}



}


}
 
C

Cor Ligthert [MVP]

Naruphon,

What is it you want to do, to add a datatable into another dataset is just
to remove it from the first and add it to the other, is that what you want
to do?

Cor
 

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

Top