473,396 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem creating DataSet structure from xsd: The same table (...) cannot be the child table in two nested relations.

Max
Suppose we have an object hierarchy in XSD.
For example, let us take Control, Label, TextBox and LinkLabel windows
controls.
Each control has some properties which are represented as elements.
Some of the elements are of complex types as well, like bounds - of type
rectangle.
(See full example in the bottom of the letter.)

DataSet.ReadXMLSchema fails to parse such XSD file.
The problem is caused by complex type as an element of the base type of
hierarchy.
(In the example this type is called rectangle.)
More specifically, when parsing the example XSD file DataSet.ReadSchema
would
1. Create table for "allowedObject" complex type.
2. Create table named "label" for label complex type.
3. Create table "bounds" for bounds element of complex type "rectangle".
4. Create table "textBox" for textBox complex type.
5. Try to create "bounds" table for bounds element of complex type
"rectangle" and fail because this table already exists.

From my point of view is a serious restriction of functionality.
I am using Visual Studio 2002 and .NET Framework 1.0.
Is it fixed in Framework 1.1?

Can you think of a workaround for this problem?
Please do not suggest to inherit control from rectangle, because in real
schema I have more then one complex property.
I can add "font" to this example to illustrate it.

Thank you.
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema targetNamespace="http://tempuri.org/XMLSchema.xsd"
elementFormDefault="qualified" xmlns="http://tempuri.org/XMLSchema.xsd"
xmlns:mstns="http://tempuri.org/XMLSchema.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:complexType name="rectangle">
<xs:sequence>
<xs:element name="left" type="xs:int" />
<xs:element name="top" type="xs:int" />
<xs:element name="width" type="xs:int" />
<xs:element name="height" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="control">
<xs:sequence>
<xs:element name="bounds" type="rectangle" />
<xs:element name="name" type="xs:string" />
<xs:element name="text" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="label">
<xs:complexContent>
<xs:extension base="control">
<xs:sequence>
<xs:element name="preferedHeight" type="xs:int" />
<xs:element name="preferedWidth" type="xs:int" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="linkLabel">
<xs:complexContent>
<xs:extension base="label">
<xs:sequence>
<xs:element name="link" type="xs:string" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="textBox">
<xs:complexContent>
<xs:extension base="control">
<xs:sequence>
<xs:element name="maxLength" type="xs:int" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="allowedObject">
<xs:choice>
<xs:element name="label" type="label" />
<xs:element name="textBox" type="textBox" />
<xs:element name="linkLabel" type="linkLabel" />
</xs:choice>
</xs:complexType>
<xs:complexType name="resource">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="allowedObject" type="allowedObject" />
</xs:sequence>
</xs:complexType>
<xs:element name="MyDataSet" type="resource" msdata:IsDataSet="true" />
</xs:schema>
Nov 12 '05 #1
0 5057

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

Similar topics

0
by: Frosty | last post by:
Hi I am using the VS xsd designer to create a strongly typed dataset. The dataset is apparently successfully created, with no warnings or errors given. Is it not then to be expected that this...
4
by: Jaga | last post by:
DataSet & XML Lesson 1 multidimensional XML data This is a known issue (KnowledgeBase 325696) "Although this XML document is well formed, it contains structure that Data view cannot display....
3
by: Mauricio Correa L. | last post by:
Hello, i have a string with a XML inside, but when a try lo load a dataset with the next code. Dim all As String = Webservice.getName(TextName.Text, TextNo2.Text).ToString 'this webmethod return...
8
by: I am Sam | last post by:
Hi everyone, This problem is making me old. I don't want to get any older. I have a multi-nested repeater control as follows: <asp:Repeater ID="clubRep1" Runat="server">...
2
by: Joe | last post by:
Hi I am going to receive a dataset downstream and I will not know the the fields number of field relations number of relations So I have to be flexible to take unknown data and be able to...
0
by: sparty1022 | last post by:
Read many of the posting but still doen't understand the process. I have a dataset with child records. I have a specific XML "Account.XSD" format that I need to write this out to. How do I...
8
by: BD | last post by:
Moving from MS Access to .Net using C# languag. Problem trying to duplicate form with structure as follows: 1. Main form 'Work Order' displayed as textboxes 2. subform 'Customers' textboxes...
4
by: Matt F | last post by:
I have an application that utilizes a dataset. I've found just today, that if the regional language settings are changed at the point of where I instantiate the DataSet an error is thrown of:...
0
by: rupalirane07 | last post by:
Both grids displays fine. But the problem is only parent datagrid sorting works fine but when i clik on child datagrid for sorting it gives me error: NullReferenceException error Any...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.