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>
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>