473,386 Members | 1,702 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,386 software developers and data experts.

xsd.exe Typed DataSet generation

Hello,

I am loading a DataSet from an xml file and binding it to a
hierarchical datagrid. I am trying to write some keys between the
elements in my xml file into the xsd file. When I write the keys as
elements it works and I get the

public QuestionRow FindByorder(short order) {
return ((MenuTitlesRow)(this.Rows.Find(new object[] {order})));
}

however when I change these to attributes I loose my this method when
running
xsd.exe test.xsd /d

I need my xml to be structured with attributes, is there anyway I can
do this without have to transform the final output.

There is curiously very little literature available on the web about
this and what is very basic.

Here is my xsd file....

<?xml version="1.0" standalone="yes"?>
<xs:schema id="Test" targetNamespace="http://tempuri.org/test.xsd"
elementFormDefault="qualified" attributeFormDefault="qualified"
xmlns="http://tempuri.org/test.xsd"
xmlns:mstns="http://tempuri.org/test.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="Test" msdata:IsDataSet="true">
<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="parent" type="xs:short" />
<xs:attribute name="suborder" type="xs:short" />
<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:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="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" use="required"
/>
<xs:attribute name="Mandatory" type="xs:string"
use="required" />
<xs:attribute name="Tooltip" type="xs:string"
use="required" />
<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:key name="QuestionKey2" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:Question" />
<xs:field xpath="mstns:id" />
</xs:key>
<xs:keyref name="QuestionOption" refer="QuestionKey2"
msdata:AcceptRejectRule="Cascade" msdata:DeleteRule="Cascade"
msdata:UpdateRule="Cascade">
<xs:selector xpath=".//mstns:Option" />
<xs:field xpath="mstns:parent" />
</xs:keyref>
<xs:key name="QuestionKey1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:Option" />
<xs:field xpath="mstns:parent" />
<xs:field xpath="mstns:suborder" />
</xs:key>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

I am trying to the following in the Update_click method of the
datagrid....
Test dst = (Test)Session("Test");
short order = Convert.ToInt16(HierarGrid1.DataKeys[e.Item.ItemIndex]);
Test.QuestionRow row =
(Test.QuestionRow)dst.Question.FindByorder(order);

also it appears DataKeys are empty...
Thanks for any light shed on this area,
Matt
Nov 12 '05 #1
0 2339

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

Similar topics

0
by: Pete Beech | last post by:
Hi, I've looked all over for any information about this, and either this is a bug that I cannot find reported or I've misunderstood something. Lets say, in the XML Designer in VS.NET 2003, you...
7
by: Jeff | last post by:
I want to remote several strongly typed datasets and I don't want to distribute the assemblies. I wish to create interface assemblies for these datasets but I don't know where to start. I've...
1
by: Rafael Veronezi | last post by:
Hello guys, I'm currently developing a Web Custom Control project with VS.Net2003. It's Ok, I've made my WebControl inherited class. Also I created a typed-DataSet that's intended to be a property...
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...
1
by: Optimus | last post by:
Hi everyone, I currently develop an application in vs.net 2005 with vb.net. I was trying to use typed dataset and I've got in trouble for converting untyped dataset into Typed DataSet. I don't...
1
by: Naveen | last post by:
Hi All, I have a web service which accepts three Typed dataset parameters and I return back two of them. The datasets use a secondary schema (the schema is imported using include tag). While...
4
by: Ronald S. Cook | last post by:
I've always used untyped datasets. In a Microsoft course, it walks through creating typed datasets and harps on the benefits. It has you drag all these things around ..wizard, wizard, wizard......
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...
4
by: Rachana | last post by:
Hi, I have understood Data Sets but what is meant by typed/untyped/ strongly typed datasets. Can any one explain me or suggest any site/ article, to get these concepts (and their ...
2
by: =?Utf-8?B?U3dhcHB5?= | last post by:
hi, I have an XSD say Family.xsd and from that xsd i want to generate autogenerated typed dataset source code by using that xsd (Version=2.0.50727.42) in C# application.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
0
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...
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...

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.