473,322 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Typed Dataset issue

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.

Jul 21 '05 #1
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.

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
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...
3
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) ...
3
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...
3
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...
2
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...
1
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...
0
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,...
21
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...
1
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...
4
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 ...
0
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
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...
1
isladogs
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...
0
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...
0
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
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
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.