W
Workaholic
Hi,
I have a test XML file, as follows:
<MAIN>
<CUSTOMER>
<NAME>First Customer</NAME>
</CUSTOMER>
</MAIN>
I am using the dataset.GetXML method to read this into VB.Net, as
follows:
Dim xmlreader As New DataSet
xmlreader.ReadXml("c:\temp\test.xml")
I want to add a child node to the XML, and have written the following
code:
xmlreader.Tables.Add("ORDERS")
xmlreader.Tables("ORDERS").Columns.Add("ORDER_NO")
xmlreader.Tables("ORDERS").Rows.Add(xmlreader.Tables
("ORDERS").NewRow)
xmlreader.Tables("ORDERS").Rows(0).Item("ORDER_NO") = 1
However, the new node is always added to the end of the XML, between
the </CUSTOMER> and </MAIN> lines
Please can somebody tell me how to amend my VB.Net code to add this
structure as a nested node under the CUSTOMER record?
Many thanks
I have a test XML file, as follows:
<MAIN>
<CUSTOMER>
<NAME>First Customer</NAME>
</CUSTOMER>
</MAIN>
I am using the dataset.GetXML method to read this into VB.Net, as
follows:
Dim xmlreader As New DataSet
xmlreader.ReadXml("c:\temp\test.xml")
I want to add a child node to the XML, and have written the following
code:
xmlreader.Tables.Add("ORDERS")
xmlreader.Tables("ORDERS").Columns.Add("ORDER_NO")
xmlreader.Tables("ORDERS").Rows.Add(xmlreader.Tables
("ORDERS").NewRow)
xmlreader.Tables("ORDERS").Rows(0).Item("ORDER_NO") = 1
However, the new node is always added to the end of the XML, between
the </CUSTOMER> and </MAIN> lines
Please can somebody tell me how to amend my VB.Net code to add this
structure as a nested node under the CUSTOMER record?
Many thanks