How can I merge an untyped nested dataset to a typed nested dataset?
From: Jim Hunt (jimh_at_netwasp.com)
Date: 10/05/04
- Next message: Charles Evans: "Exporting to Microsoft Excel"
- Previous message: Philip Poole: "Re: DateTime"
- Messages sorted by: [ date ] [ thread ]
Date: 5 Oct 2004 09:13:03 -0700
I am using a typed DataSet. I want to load the country and network
data from the database. I can do this using a non-Typed DataSet using
two seperate queries and setting up a relationship between the two
resulting DataTables. I can also get it to return a Nested XML string
by setting the Netsted property to true. I am unable to merge this
untyped DataSet with a Typed one due to a known bug in the 1.1
Framework and blows up when the Nested property is accessed. I woudl
like to be able to do it manually as it's not a lot of data but I am
unable to manually create a typed DataRow. How can I do this? I've
also tried sucking the XML fromthe untyed DataSet into the Typed one
and this doesn't work either (the untyped one is in fact just a
fragment of the entire typed one). I've tried using Import and I've
tried using Merge - these just blow up because of this bug. I've been
tryog tor 2 days now and I just can't figure out from the MSDN
documentation a way of doing this
This is the schema used by the typed DataSet:
<?xml version="1.0" standalone="yes"?>
<xs:schema id="ResultData" xmlns="http://blah.com"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="ResultData" msdata:IsDataSet="true"
msdata:Locale="en-GB">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="DataSet">
<xs:complexType>
<xs:sequence>
<xs:element name="resultcode" type="xs:string"
minOccurs="0" />
<xs:element name="networks" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="country" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="network" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="id" type="xs:string"
/>
<xs:attribute name="name"
type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:string" />
<xs:attribute name="name" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
And here is an example of some XML
<ResultData xmlns="http://blah.com">
<DataSet>
<resultcode>0</resultcode>
<networks>
<country id="227" name="UK">
<network id="10" name="O2" />
<network id="15" name="Vodafone" />
</country>
<country id="228" name="US">
<network id="31" name="T-Mobile" />
<network id="20" name="Vodafone" />
</country>
</networks>
</DataSet>
</ResultData>
- Next message: Charles Evans: "Exporting to Microsoft Excel"
- Previous message: Philip Poole: "Re: DateTime"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|