473,788 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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!Addre ss]
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.Fragme nt), the relation between the Customer table and the
Details table are not linked in any way.

However, when I load the DataSet using ReadMode.InferS chema and then
write out the schema (with ds.WriteXmlSche ma), 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 2054

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

Similar topics

28
2214
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. The problem that I'm facing that both organizations and individual users may have relationships with other entities which are semantically the same. For instance, an individual user can purchase things and so can an organization. An individual...
1
1527
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, typename X::C) and specialise it in the case X takes some particular value, such as: >template<> typename Bar::A Foo<Bar>(typename Bar::B, typename Bar::C)
0
1287
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 "InvoiceDetail" -> "id, date" Then I created a relationship between both these item using the key "id". This create the one-to-many relationship.
3
6051
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" wich may again contain one more "Items". Now how would I design a set of SQL Tables that are capable of storing this information? I tried the following two approaches:
7
1194
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 category and its children (to a specified depth) and display it in a repeater (for example). i.e. category1 ---category1 child ------categrory1 grandchild
0
1099
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 one on the web page. The fields are all coming from the same table from the same stored proc. Also, I cannot do two separate stored procs for the parent and child tables. I tried to do a relation on the same table and it throws an error 'ParentKey...
0
7237
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 "Invalid character in Base-64 string." My code is like this. XmlTextReader xmlReader = new XmlTextReader(XML_LAYOUT_FILE_PATH); XmlDocument doc = new XmlDocument(); doc.Load(xmlReader); StringWriter writer...
12
11111
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. Here is a newbie mistake that I found myself doing (as a newbie), and that even a master programmer, the guru of this forum, Jon Skeet, missed! (He knows this I'm sure, but just didn't think this was my problem; LOL, I am needling him) If...
2
1621
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 bind this two collection classes with this child and parent relationship . Please anybody can help me out.. Prakash
0
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10366
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10173
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9967
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
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 project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5399
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3674
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.