I am creating an xml file using c# dataset.writexml() method. One of my parent tables have two child tables, and I want the xml to display records from both tables together. I added relations in my dataset between Parent table and child tables, but I am not getting the records together. The xml always have all records from Child table 1 together followed by all records from Child table 2.
Is there any way to get record 1 from both tables, followed by record 2 from both tables and so on.
<Parent>
<Child Table 1 Row 1>
<Child Table 2 Row 1>
<Child Table 1 Row 2>
<Child Table 2 Row 2>
<\parent table>
The sample xml would look like this. This is what the customer is asking for.
<Parent>
<Count>2</Count>
<Child 1>
<ID>111</ID>
<No>11111</No>
</Child 1>
<Child 2>
<AppNo>11111111</AppNo>
</Child 2>
<Child 1>
<ID>222</ID>
<No>22222</No>
</Child 1>
<Child 2>
<AppNo>22222222</AppNo>
</Child 2>
<\Parent>