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 1213
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: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |