I want to modify an existing XML-File.
I used a DataSet to load the XML File with the ReadXml method.
I then displayed the relevant entries via the GetChildRows method.
I want to change/add/delete those ChildRows:
How can I accomplish this?
Below is the xml before edit
<einginedesign>
<object om_id="111" objname="DelivaryInfo">
<objprop prop_id="1">
<prop_name>OrderRef</prop_name>
<prop_desc>Order Reference</prop_desc>
<prop_dtype>varchar</prop_dtype>
</objprop>
</object>
</einginedesign>
after i editing in the dataset and write to xml file.
the new added (child rows) are out of object.
<einginedesign>
<object om_id="111" objname="DelivaryInfo">
<objprop prop_id="1">
<prop_name>OrderRef</prop_name>
<prop_desc>Order Reference</prop_desc>
<prop_dtype>varchar</prop_dtype>
</objprop>
</object>
<objprop prop_id="2">
<prop_name>TransNo</prop_name>
<prop_desc>Transaction number</prop_desc>
<prop_dtype>Numeric</prop_dtype>
</objprop>
</einginedesign>
If you look at the below example, in order for it to be a child you will need to set the parent row, the below code xml will give the expected output:
This is very basic and you would obviously have to search for the correct parent row etc.