473,324 Members | 2,193 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,324 software developers and data experts.

Typed DataSet - Full support

Hello,

Can anyone please help me to understand why when I use one XSD file to
create a DataSet.cs file it gives me a much longer file with more cs
code which allows Typing for all my elements and another which has the
same keys but has an additional level of nest which produces a much
smaller DataSet.cs file

using command line xsd test.xml /d

Here are the 2 xsd files...thanks

if not perhaps any books or links to good detailed (not examples in a
vacuum) explainations of the use of XSD, Typed DataSets in Visual
Studio.net

this give full typed support

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="Test" xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="Test" msdata:IsDataSet="true"
msdata:Locale="en-GB">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Question">
<xs:complexType>
<xs:sequence>
<xs:element name="Option" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="Text" type="xs:string" />
<xs:attribute name="Selected" type="xs:string" />
<xs:attribute name="Tooltip" type="xs:string" />
<xs:attribute name="Answer" type="xs:string" />
<xs:attribute name="question_id" type="xs:short"
use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:short" use="required" />
<xs:attribute name="section_id" type="xs:short" use="required"
/>
<xs:attribute name="Text" type="xs:string" use="required" />
<xs:attribute name="Type" type="xs:string" use="required" />
<xs:attribute name="Score" type="xs:string" default="0" />
<xs:attribute name="Mandatory" type="xs:string" default="false"
/>
<xs:attribute name="Tooltip" type="xs:string" use="optional" />
<xs:attribute name="MultiSelect" type="xs:string" use="optional"
/>
<xs:attribute name="AllowNoSelection" type="xs:string"
use="optional" />
<xs:attribute name="Multiline" type="xs:string" use="optional"
/>
<xs:attribute name="MaxLength" type="xs:string" use="optional"
/>
<xs:attribute name="MinLength" type="xs:string" use="optional"
/>
<xs:attribute name="InitialValue" type="xs:string"
use="optional" />
<xs:attribute name="Validation" type="xs:string" use="optional"
/>
<xs:attribute name="Answer" type="xs:string" use="optional" />
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:key name="QuestionKey2" msdata:PrimaryKey="true">
<xs:selector xpath="Question" />
<xs:field xpath="@id" />
</xs:key>
</xs:element>
</xs:schema>

this does not why?

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="test2" xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="TestSection" msdata:IsDataSet="true"
msdata:Locale="en-GB">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Section" minOccurs="0" maxOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="Question" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Option" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="Text" type="xs:string" />
<xs:attribute name="Selected" type="xs:string" />
<xs:attribute name="Tooltip" type="xs:string" />
<xs:attribute name="Answer" type="xs:string" />
<xs:attribute name="question_id" type="xs:short"
use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:string" />
<xs:attribute name="Text" type="xs:string" />
<xs:attribute name="Type" type="xs:string" />
<xs:attribute name="Score" type="xs:string" />
<xs:attribute name="Mandatory" type="xs:string" />
<xs:attribute name="Tooltip" type="xs:string" />
<xs:attribute name="MultiSelect" type="xs:string" />
<xs:attribute name="AllowNoSelection" type="xs:string" />
<xs:attribute name="Multiline" type="xs:string" />
<xs:attribute name="MaxLength" type="xs:string" />
<xs:attribute name="MinLength" type="xs:string" />
<xs:attribute name="InitialValue" type="xs:string" />
<xs:attribute name="Validation" type="xs:string" />
<xs:attribute name="Answer" type="xs:string" />
<xs:attribute name="section_id" type="xs:short"
use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:string" />
<xs:attribute name="name" type="xs:string" />
<xs:attribute name="NumberOfQuestions" type="xs:string" />
<xs:attribute name="Type" type="xs:string" />
<xs:attribute name="Score" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
<xs:key name="TestSectionKey1">
<xs:selector xpath=".//Section" />
<xs:field xpath="@id" />
</xs:key>
<xs:key name="TestSectionKey2">
<xs:selector xpath=".//Question" />
<xs:field xpath="@id" />
</xs:key>
<xs:keyref name="SectionQuestion" refer="TestSectionKey1"
msdata:ConstraintOnly="true">
<xs:selector xpath=".//Question" />
<xs:field xpath="@section_id" />
</xs:keyref>
<xs:keyref name="QuestionOption" refer="TestSectionKey2"
msdata:ConstraintOnly="true">
<xs:selector xpath=".//Option" />
<xs:field xpath="@question_id" />
</xs:keyref>
</xs:element>
</xs:schema>
Nov 12 '05 #1
0 1407

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

Similar topics

1
by: Efy. | last post by:
Hello, The following problam description I did not need to write, I just copied from the groups from others which met the error and allways the thread was 1 artical the problem was never...
0
by: Jeremy Summers | last post by:
Has anyone run into problems creating typed datasets from complex schemas? I am attempting to create a Typed Dataset in Visual Studio .Net from a .xsd schema file for a industry standard web...
0
by: Bj?rn Mor?n | last post by:
I am consuming a web service that returns arrays of classes which can contain other classes (a hierarchy of data). Is there a simple way to move the data into a typed DataSet without writing too...
0
by: nima | last post by:
Hi I have two tables in my database. PRODUCT and PRODUCT_GROUP. PRODUCT has a foreign key to PRODUCT_GROUP. I generated a typed dataset using VS.net and added a relationship between the two...
0
by: Ryan Shaw | last post by:
I have a typed dataset which I inherit in a Business Object. I want to add an element when the Business Object is Serialized. public class OrderBLL:OrderMDL /OrderMDL is a typed dataset...
4
by: Ben | last post by:
So, at my place of employment, we use a national standard to transmit data between certain applications. This standard consists of a fixed width, flat file 4500-some-odd chars wide that contain...
3
by: Freeon | last post by:
Hi, I am looking for a way to sort a strong typed dataset. It would seem the most straightforward way is to use a dataview. The only problem is when I use the dataview I seem to loose the strong...
21
by: Peter Bradley | last post by:
Hi all, This post is sort of tangentially related to my earlier posts on configuration files for DLLs. Does anyone know how to create typed DataSets using VS2005's new DataSet designer, but...
7
by: =?Utf-8?B?TWF4R3J1dmVu?= | last post by:
I have a DLL that implements the Business and Data Layers for a number of different websites. That DLL uses a Strongly Typed DataSet to interface to the Data Source which is SQL Server. There...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.