Hi
I have a program which reads a xml schema file and also reads a input xm l file and if there is a element present in the schema which is also present in imput xml fle. it stores the vaues of input xml file for theat element intoa new xml file , while the other elements present in the schema are automatically getting values acccording to the datatype.
private void button2_Click(object sender, System.EventArgs e)
{
dataSet1.ReadXmlSchema(txtSchema.Text);//txtschema is the schema file
XmlDocument xdc = new XmlDocument();
foreach (DataTable dTbl in dataSet1.Tables)
{
object[] oValues = new object[dTbl.Columns.Count];
xdc.Load(@"C:\CDEV\generator\testdatagenerator\FIELDNAMES.xml");
int i=0, iIndex=0;
foreach (DataColumn dColmn in dTbl.Columns)
{
if(dColmn.ColumnName.ToString() == "billto_name")
{
iIndex = i;
break;
}
i++;
}
//INPUT XML FILE
xdc.Load(@"C:\CDEV\generator\testdatagenerator\billtoname.xml");
XmlNodeList nodeRows;
XmlElement Root = xdc.DocumentElement;
nodeRows = Root.SelectNodes("//billto_name");
for(int j = 0; j <= 200; j++)
{
int k = 0;
foreach (DataColumn dColmn in dTbl.Columns)
{
if(j == iIndex && j