Hi,
Simple situation: A DataTable with some columns and rows added. But when using the WriteXML method to create an XML file from this table it gives me the following output:
< xml version="1.0" encoding="utf-8" >
<DocumentElement>
<Batch_Table>
<Height>18</Height>
<Width>75</Width>
<Program>1</Program>
<Length1Min>18</Length1Min>
<Length1Max>60</Length1Max>
<Price1>1000</Price1>
</Batch_Table>
<Batch_Table>
<Height>25</Height>
<Width>125</Width>
<Program>2</Program>
<Length1Min>12</Length1Min>
<Length1Max>40</Length1Max>
<Price1>1200</Price1>
<Length2Min>40</Length2Min>
<Length2Max>60</Length2Max>
<Price2>1300</Price2>
</Batch_Table>
...and so on. The problem is that each row/record of the table is named as the table, i.e., DataTable.TableName = "Batch_Table". This is wrong! How can I fix this
Thanks.
/Magnus

DataTable.WriteXML() gives incorrect XML output
Uma Anand M
There is nothing wrong with the XML that the WriteXml method outputs. It is wellformed and valid XML.
If that format is not suitable for your needs you can either transform the XML document written with XSLT or create your own WriteXml function that outputs it as you would like.
If you are more specific in what you need and want to do maybe there are more solutions than what I mentioned.