473,598 Members | 3,252 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dataset.GetXml( ) returns "A child row has multiple parents" exception

muaddubby
8 New Member
Hi

I've got a situation with a dataset that contains two tables with a many-to-one relationship, and am trying to extract the data in xml format. When I execute the GetXml() method, and exception is thrown telling me that "A child row has multiple parents", and the xml is obviously not generated.

The output I'm expecting is something like this:

Expand|Select|Wrap|Line Numbers
  1. <parent>
  2.     <parentRecnum>1</parentRecnum>
  3.     <childRecnum>1</childRecnum>
  4.     <child>
  5.         <childRecnum>1</childRecnum>
  6.         <description>this child's description</description>        
  7.     </child>
  8. </parent>
  9. <parent>
  10.     <parentRecnum>2</parentRecnum>
  11.     <childRecnum>1</childRecnum>
  12.     <child>
  13.         <childRecnum>1</childRecnum>
  14.         <description>this child's description</description>        
  15.     </child>
  16. </parent>
  17. <parent>
  18.     <parentRecnum>3</parentRecnum>
  19.     <childRecnum>1</childRecnum>
  20.     <child>
  21.         <childRecnum>1</childRecnum>
  22.         <description>this child's description</description>        
  23.     </child>
  24. </parent>
I see absolutely no reason why an xml document could not include the same <child> element under each one of the parent elements, and yet the dataset is telling it can't do it. Any ideas on how to get around this? I know that turning the relationship around would be one way, but the xml would come out backwards and that's not what I'm looking for.

Thx.
Aug 5 '08 #1
0 2646

Sign in to post your reply or Sign up for a free account.

Similar topics

3
4138
by: Eric Decker | last post by:
With framework 1.0 the dataset.getxml() method returned the children nested within the parent. This doesn't seem to function this way with 1.1. Is there something I'm missing?
2
3355
by: exBK | last post by:
Hi, I am writing out the DataSet.GetXml() to a file as below: Response.AddHeader ("Content-disposition", @"attachment; filename=Employee.xml"); Response.ContentType = "application/ms-tnef"; Response.Write(dsEmployee().GetXml()); Response.End(); I get the XML but the problem I am having is: in a few places where I have
0
336
by: william | last post by:
Hi, Here is what I've done: 1. create a XML schema for creating typed dataset. 2. declare a typed dataset as the XML schema of step 1. 3. when I fill the dataset of step 2, I applied table mapping. 4. call dataset.GetXML function to get a xml string. When I checked the xml file, I found a few attributes with d2p1 namespace, for example, <mem_plan mem_key="111" mem_hire="2003/1/2" d2p1:salary_min="0"
0
1324
by: vavavoomy2 | last post by:
Hello, I have a dataset bound to some graphical controls, which I use to reorder the rows. My problem is when I get the dataset into XML format, The Xml rows are not ordered correctly-- they don't reflect the changes I made in ordering teh rows. OK, so row ordering is not guaranteed-- although I could have sworn I read it was in some documentation-- but anyway, how can I capture the row order? I don't want to explicitly keep an...
1
2012
by: Kashyap | last post by:
Hi I am trying to convert a dataset to xml using dataset.getxml. But this xml doesn't contain elements for null columns that are present in the dataset. How can we explicitly control this behaviour Suppose I have this dataset Col1 Col2 Col3 Col ----- ---- ---- --- A1 A2 A3 A
1
2778
by: Nanda | last post by:
Hi All, Thanks for u r Valuable postings. Here is a Problem for me. I need to reprsent the NULL value of a column in Database in an XML File as follows. <Employees> <Employee>
1
1840
by: Elad | last post by:
hi, I'm sorry if this isn't the right group, I just didnt know which category to place this question in. Anyway, I have 2 problems: I got a web service which connects to a DB and puts the data in a DataSet, and sends back to the user the DataSet.GetXml() (I know that a Dataset is serializable, but i need it's xml. anyway, this method does not create tags with no values in the output xml, in case a certain field in the DB equals...
1
1769
by: Ganesh Muthuvelu | last post by:
Hello, Is it possible to make the dataset give the "xsi:type" data as well?. I need result from the dataset.GetXML method something like this for the column "a": <a xsi:type="int">12</a> Is it possible?. I would appreciate any pointers/code help. Thanks.
1
1257
by: lucky | last post by:
Hi guys! i'm facing very strange problem. i've a DataSet object in which i add some tables the some logic finishes successfully. and after then i tried to get the XML string from the DataSet but it returns only first 2 tables in that string. here is the code that i'm using to add tables into the DataSet and then tried to get the xml from the dataset
0
7987
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7899
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
8392
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
8397
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
8050
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
5438
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3897
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...
1
2412
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1250
bsmnconsultancy
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.