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. 1 1216
you assumed that the dataset will serialize the records based on some
relation between the tables - well, it doesn't. It serializes the
dataset one table after another (and will even support loading an XML in
which records from different tables are mixed, I suspect)
william wrote: 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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Natehop |
last post by:
I've been attempting to design an n-tiered framework leveraging .NET's
strongly typed Dataset. My Framework will serve as the foundation to
several client apps from Windows applications to web...
|
by: Chris Thunell |
last post by:
I have 2 forms, on 1 form i use the wizards to create a strong typed dataset
with tables from an SQL database... and from that i can do stuff like:
me.daEmployee.fill(me.dataset11.tblEmployee) ...
|
by: Freeon |
last post by:
Hi, I am looking for a way to sort a strong typed dataset. It would seem the most straightforward way is to use a dataview. The only problem is when I use the dataview I seem to loose the strong...
|
by: Tolga Erdogus |
last post by:
Hi,
for a project that I am wrapping up I am writing documentation. I'd like to
be able to put in xmldoc style comments in to the source of my strongly
typed dataset, its tables, relationshipts...
|
by: Phil |
last post by:
I need to created a typed dataset for a xml flat file and bind that dataset
to a combobox. I was able to do this in VS.Net 2003 easy enough, but can't
get it to work in VS.Net 2005. I've come...
| |
by: Optimus |
last post by:
Hi everyone,
I currently develop an application in vs.net 2005 with vb.net.
I was trying to use typed dataset and I've got in trouble for
converting untyped dataset
into Typed DataSet. I don't...
|
by: Liming |
last post by:
Hi,
I designed a few DataSet Tables in the typed dataset dsigner. Recently,
I encountered an error saying
Failed to enable constraints. One or more rows contain values violating
non-null,...
|
by: Peter Bradley |
last post by:
Hi all,
This post is sort of tangentially related to my earlier posts on
configuration files for DLLs.
Does anyone know how to create typed DataSets using VS2005's new DataSet
designer, but...
|
by: zlf |
last post by:
Hello
As a known issue, WCF does not allow to transfer typed DataSet. So I have to
copy all data from typed DataSet to untyped DataSet(same table names, column
names and row data). What is the...
|
by: Rachana |
last post by:
Hi,
I have understood Data Sets but what is meant by typed/untyped/
strongly typed datasets. Can any one explain me or suggest any site/
article, to get these concepts (and their ...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |