Dataset problem-- while using complexTypes

T

tabrez

Hi,
I am facing a problem while trying to use complexType in
an element. I want to nest an element "somechildren" into
an element "some". This can be done by creating a nested
relationship between "some" and "somechildren". However,
the problem is that the fields in the child
table "somechildren" that I require for creating the
relationship are distributed as simple elements and
elements within a complexType element.

The schema editor does allow me to graphically create this
relationship but its unable to generate the code for it.

Any ideas? I am trying to establish a relationship between
"line" and "id" fields of table "some" to "line"
and "parentid" fields of table "somechildren".

The schema is as below (its from vs.net and so you may
open it up in vs.net):

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="DataSet3"
targetNamespace="http://tempuri.org/DataSet3.xsd"
elementFormDefault="qualified"
attributeFormDefault="qualified"
xmlns="http://tempuri.org/DataSet3.xsd"
xmlns:mstns="http://tempuri.org/DataSet3.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="DataSet3"
msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="some">
<xs:complexType>

<xs:sequence>

<xs:element name="line" type="xs:int"
minOccurs="0" />

<xs:element name="somedata" type="somedata"
minOccurs="0" />

</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element
name="somechildren">
<xs:complexType>

<xs:sequence>

<xs:element name="line" type="xs:int"
minOccurs="0" />

<xs:element name="somechildrendata"
type="somedata" minOccurs="0" />

</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
 
C

Cor

Hi Tabrez,

I was looking very long for it, but as far as I know until today SQL is not
able to do complex datatypes.

And therefore when you reach to do something with it, it brings the dataset
back to a related not complex datatype XML/SQL structure.

I hope this helps searching, but when someone knows the answer please tell
me?

Cor
 
T

tabrez

Hi Cor,
Thanks for the response! It seems then that we have to
live with this issue as such. I had to redesign my schema
to make it relational (which meant more tables than
reqd!). Also, now I am making sure that I have only one
nested relationship (by making all the relations 1-*).

Thanks,
tabrez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top