pls correct the error in this part of the program
-
Hi I have done a program , here The program reads any xml schema file and automatically writes 200 data's to a xml file(name as result.xml)according to their data types. say for string-john1, john2,john3...etc.. say for decimal-101.20, 102.20, 103.20 ..etc.. so on. And the program also reads a xml file with single field named address(for ex:) . so the program what it does is checks the schema file whether there is any element named "address" and it stores the fieldnumber(position of the field) and the field name in an array. then the program reads a another input xml file(which has address values ). then it stores the values from the input xml file into the resultxml I have done it and I am coming across some errors.I will paste the part of the program what I did.. Please help me to sort out the error. private void button2_Click(object sender, System.EventArgs e) { ArrayList FiledNames = new ArrayList(); ArrayList MatchList = new ArrayList(); XmlTextReader xtr = new XmlTextReader(@"C:\CDEV\testdatagenerator\FIELDNAMES.xml"); while (xtr.Read()) { switch (xtr.NodeType) { case XmlNodeType.Element: FiledNames.Add(xtr.Name); break; } } xtr.Close(); XmlDocument xdc = new XmlDocument(); xdc.Load(@"C:\CDEV\testdatagenerator\vw_forecast.xml"); dataSet1.ReadXmlSchema(txtSchema.Text); foreach (DataTable dTbl in dataSet1.Tables) { int i = 0; object[] oValues = new object[dTbl.Columns.Count]; xdc.Load(@"C:\CDEV\testdatagenerator\FIELDNAMES.xml"); foreach (DataColumn dColmn in dTbl.Columns) { for (int y=0; y
-
Hi I have done a program , here The program reads any xml schema file and automatically writes 200 data's to a xml file(name as result.xml)according to their data types. say for string-john1, john2,john3...etc.. say for decimal-101.20, 102.20, 103.20 ..etc.. so on. And the program also reads a xml file with single field named address(for ex:) . so the program what it does is checks the schema file whether there is any element named "address" and it stores the fieldnumber(position of the field) and the field name in an array. then the program reads a another input xml file(which has address values ). then it stores the values from the input xml file into the resultxml I have done it and I am coming across some errors.I will paste the part of the program what I did.. Please help me to sort out the error. private void button2_Click(object sender, System.EventArgs e) { ArrayList FiledNames = new ArrayList(); ArrayList MatchList = new ArrayList(); XmlTextReader xtr = new XmlTextReader(@"C:\CDEV\testdatagenerator\FIELDNAMES.xml"); while (xtr.Read()) { switch (xtr.NodeType) { case XmlNodeType.Element: FiledNames.Add(xtr.Name); break; } } xtr.Close(); XmlDocument xdc = new XmlDocument(); xdc.Load(@"C:\CDEV\testdatagenerator\vw_forecast.xml"); dataSet1.ReadXmlSchema(txtSchema.Text); foreach (DataTable dTbl in dataSet1.Tables) { int i = 0; object[] oValues = new object[dTbl.Columns.Count]; xdc.Load(@"C:\CDEV\testdatagenerator\FIELDNAMES.xml"); foreach (DataColumn dColmn in dTbl.Columns) { for (int y=0; y
At a quick glance I noticed that your first "for" loop is incorrect..... What is the exception you're getting?