473,324 Members | 1,678 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,324 software developers and data experts.

FOR XML Explicit, XMLDATA not giving relationship information in XDR for nested XML

Chi
This is a problem that has been nagging me for a while, and I cannot
figure out how to best solve the problem:

I have a stored procedure that returns multi-level "nested" XML and
inline XDR. My goal is to have a .NET application read the XML into a
DataSet using the inline schema, and the relations automatically
created according to the nesting of the elements.

My query in the stored procedure looks similar to this:

SELECT 1 AS TAG,
NULL AS PARENT,
c.name [Customer!1!Name]
NULL [Details!2!Address]
FROM Customer c
UNION ALL
SELECT 2 AS TAG,
1 AS PARENT,
NULL,
c.address
FROM Customer c
FOR XML EXPLICIT, XMLDATA

The XML that gets returned looks fine, but the XDR does not contain
any relation information. That is, the schema does not restrict how
the <Details> element must be nested within the <Customer> element.

Therefore when I use my .NET app to load the XML into a DataSet (using
ReadMode.Fragment), the relation between the Customer table and the
Details table are not linked in any way.

However, when I load the DataSet using ReadMode.InferSchema and then
write out the schema (with ds.WriteXmlSchema), the XSD indeed contains
the relation information. If I use the XSD schema next time to load
the DataSet, the tables in the DataSet will have the appropriate
relations.

My question is, how can I use XMLDATA in my stored procedure to create
relation information, so that my DatSet can auto-generate the
relations when it loads the XML? More generally, is there a way to
create an inline schema such that I can auto-generate the "nested"
relations in a DataSet?
Nov 11 '05 #1
0 2024

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

Similar topics

28
by: Jeff Lanfield | last post by:
Suppose I have users that can belong to organizations. Organizations are arranged in a tree. Each organization has only one parent organization but a user maybe a member of multiple organizations....
1
by: Thomas Barnet-Lamb | last post by:
I have a query concerning the handling of explicit specializations. Essentially, I want to know whether it is legal to take a template like >template<class X> typename X::A Foo(typename X::B,...
0
by: Joey Lee | last post by:
Hi, I have created a dataset schema(*.xsd) which contain two element "InvoiceHeader" and "InvoiceDetail". I set the primary key of both the element. for example "InvoiceHeader" -> id and...
3
by: Robert Ludig | last post by:
I am fairly new to SQL and I am currently trying to create a SQL table (using Microsoft SQL) that has a recursive relationship, let me try to explain: I have a piece of Data let's call it "Item"...
7
by: JJ | last post by:
I am trying to set up a SQL table with associated stored procedures to be able to have nested 'categories' to any depth. I need to then be able to retrieve (or move or delete) a particular...
0
by: vivajay | last post by:
I'm trying to do a parent/child relationship in nested datalists I have created. I do not want to repeat the contract number for each asset that falls within that contract number when I display each...
0
by: BobbyS | last post by:
I've a xml file.I'm taking its data passing it to a method in string form and converting that string "xmlData" to a array of bytes by Convert.FromBase64String(xmlData) but I'm getting a exception...
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
2
by: prakashbpl1 | last post by:
Hi All, Hi query is regarding ASP.NET and C# developement ,how to create relationship between two IList collection classes.By this collection relationship I want to create a nested GridView and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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.