This is my sample.xml file. I'm looking for instruction how to read this and put content from all nodes (subnodes) to DataSet and show it in DataGrid. I can only read single Node (without subnodes).
My code is below:
Private Sub ReadXmlButton_Click() Handles ReadXmlButton.Click
Dim filePath As String = "C:\Path\"
DataSet.ReadXml("C:\Path\sample.xml")
DataGridView1.DataSource = DataSet
DataGridView1.DataMember = "CART_ID"
End Sub
But it reads only head Node without SubNodes (1000, 10.05, YES, 8, 2). I want to display all informations (example: 1000, 10.05, A1A, Triangle, 10, 1, YES, 8, 2) from first (and all)CART_ID
in DataGridView.
sample.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<XML_FILE>
<typ>xml</typ>
<ID>
<NR>007</NR>
</ID>
<PERSONAL>
<Surname>John</Surname>
<Name>Smith</Name>
</PERSONAL>
<COUNTRY>
<CName>UK</CName>
</COUNTRY>
<CITY>
<TOWN>
<TOWN_ID>
<PART_ID>
<CART_ID>
<SIMPLE_ID>1000</SIMPLE_ID>
<SIMPLE_AREA_ID>10.05</SIMPLE_AREA_ID>
<PLACE_ID>
<SPECIFIC_ID>
<id>A1A</id>
<name>Triangle</name>
<area>10</area>
<note>1</note>
</SPECIFIC_ID>
</PLACE_ID>
<Control>YES</Control>
<Control_area>8</Control_area>
<Control_rest>2</Control_rest>
</CART_ID>
<CART_ID>
<SIMPLE_ID>2000</SIMPLE_ID>
<SIMPLE_AREA_ID>20.05</SIMPLE_AREA_ID>
<PLACE_ID>
<SPECIFIC_ID>
<id>B1B</id>
<name>Triangle</name>
<area>20</area>
<note>2</note>
</SPECIFIC_ID>
</PLACE_ID>
<Control>YES</Control>
<Control_area>18</Control_area>
<Control_rest>2</Control_rest>
</CART_ID>
</PART_ID>
</TOWN_ID>
</TOWN>
</CITY>
</XML_FILE>
UPDATED: The last thing is how to save modified descendant (for example - manually changed SIMPPLE_ID from 1000 to 5000, etc.) to original sample.xml file ? Is it possible to do it with this solution or should I look for other way ?