473,568 Members | 2,935 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.ReadXML Schema 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.ReadSch ema
would
1. Create table for "allowedObj ect" 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"
elementFormDefa ult="qualified" xmlns="http://tempuri.org/XMLSchema.xsd"
xmlns:mstns="ht tp://tempuri.org/XMLSchema.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="u rn:schemas-microsoft-com:xml-msdata">
<xs:complexTy pe 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:complexTy pe 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:complexTy pe name="label">
<xs:complexCont ent>
<xs:extension base="control">
<xs:sequence>
<xs:element name="preferedH eight" type="xs:int" />
<xs:element name="preferedW idth" type="xs:int" />
</xs:sequence>
</xs:extension>
</xs:complexConte nt>
</xs:complexType>
<xs:complexTy pe name="linkLabel ">
<xs:complexCont ent>
<xs:extension base="label">
<xs:sequence>
<xs:element name="link" type="xs:string " />
</xs:sequence>
</xs:extension>
</xs:complexConte nt>
</xs:complexType>
<xs:complexTy pe name="textBox">
<xs:complexCont ent>
<xs:extension base="control">
<xs:sequence>
<xs:element name="maxLength " type="xs:int" />
</xs:sequence>
</xs:extension>
</xs:complexConte nt>
</xs:complexType>
<xs:complexTy pe name="allowedOb ject">
<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:complexTy pe name="resource" >
<xs:sequence minOccurs="0" maxOccurs="unbo unded">
<xs:element name="allowedOb ject" type="allowedOb ject" />
</xs:sequence>
</xs:complexType>
<xs:element name="MyDataSet " type="resource" msdata:IsDataSe t="true" />
</xs:schema>
Nov 12 '05 #1
0 5073

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

Similar topics

0
1964
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 dataset then should reflect all the details put into the xsd? Somewhere down the line there is not a 1:1 relationship. Be it that .NET is so tightly...
4
1708
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. The same table (Table name) cannot be the child table in two nested relations." : <?xml version="1.0" ?> <root>
3
1404
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 a string wit a XML inside Dim xmlreader As New System.IO.StringReader(all) Dim datas As New DataSet datos.ReadXml(xmlarchivo) I have the next...
8
2900
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"> <HeaderTemplate><table> </HeaderTemplate> <ItemTemplate>
2
2483
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 summarize all the info being passed
0
1925
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 marry these (2) items to create the output file. Dim dataSet As DataSet = New DataSet("AccountRecord") PremisesAdapter.Fill(dataSet, "Premises")...
8
1828
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 showing name, address, etc related by 'CustomerID' 3. subform 'Locations' textboxes showing name, address, etc related by 'LocationID' 4. subform...
4
5627
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: "Cannot add a DataRelation or Constraint that has different Locale or CaseSensitive settings between its parent and child tables." The particular...
0
2071
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 help........pls urgent ========================================================= <%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm3.aspx.vb"...
0
7693
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...
0
7605
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...
0
7917
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. ...
1
7665
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...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6277
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
2105
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
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
933
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...

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.