Hi,
I was using Typed Dataset in VB.NET to generate XML file.
I difined XSD file( named customer_order_info) to include three tables,
let's say customers, orders and order_details. I also defined relationship
between customers and orders, orders and order_details.( customerid is PK in
customers, orderid is PK in orders, orderid and productid are PK in
order_details).
In my VB.NET code, I declared a variable as the XSD(customer_order_info),
declared a adapter to populate it(some common routines to get dataset). the
select command is a stored procedure which will retuen 3 recordsets. I also
defined table mappings when I populated the dataset. After I got the dataset,
I call ds.getXML to get xml file. I was able to get the file with correct
content, but the format is wrong. For eample, the format should be as follows:
<customer customerid=â??aaaâ?? name=â??billâ?? phone=â??123345456â?? >
<order orderid=â??1011â?? customerid=â??aaaâ?? shipname=â??Du monde entireâ??>
<order_detail orderid=â??1011â?? productid=â??tool1â?? quantity=â??12â??/>
<order_detail orderid=â??1011â?? productid=â??tool2â?? quantity=â??20â??/>
<order_detail orderid=â??1011â?? productid=â??tool3â?? quantity=â??30â??/>
</order>
<order orderid=â??1012â?? customerid=â??aaaâ?? shipname=â??Du monde entireâ??>
<order_detail orderid=â??1012â?? productid=â??tool4â?? quantity=â??12â??/>
<order_detail orderid=â??1012â?? productid=â??tool2â?? quantity=â??20â??/>
<order_detail orderid=â??1012â?? productid=â??tool5â?? quantity=â??30â??/>
</order>
</customer>
But I got :
<customer customerid=â??aaaâ?? name=â??billâ?? phone=â??123345456â?? >
<order orderid=â??1011â?? customerid=â??aaaâ?? shipname=â??Du monde entireâ??/>
<order orderid=â??1012â?? customerid=â??aaaâ?? shipname=â??Du monde entireâ??/>
<order_detail orderid=â??1011â?? productid=â??tool1â?? quantity=â??12â??/>
<order_detail orderid=â??1011â?? productid=â??tool2â?? quantity=â??20â??/>
<order_detail orderid=â??1011â?? productid=â??tool3â?? quantity=â??30â??/>
<order_detail orderid=â??1012â?? productid=â??tool4â?? quantity=â??12â??/>
<order_detail orderid=â??1012â?? productid=â??tool2â?? quantity=â??20â??/>
<order_detail orderid=â??1012â?? productid=â??tool5â?? quantity=â??30â??/>
</customer>
Could anyone help me out?
Thanks.