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"]);
}
}
}
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"]);
}
}
}