468,786 Members | 1,736 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,786 developers. It's quick & easy.

Enumerations in a strongly typed DataSet

Hi all,

I've added a new DataSet (xsd file) to my project in VS.NET 2003.
There I create a simple type as an enumeration of values.

<xs:simpleType name="MyCustomType">
<xs:restriction base="xs:string">
<xs:enumeration value="Apple" />
<xs:enumeration value="Orange" />
</xs:restriction>
</xs:simpleType>

However, when I compile the project, the .cs file generated for the DataSet
by VS.NET doesn't convert MyCustomType into an "enum" structure. The tpe
remains System.String. Is this the normal behavior?

-Oleg.
Nov 15 '05 #1
1 5406
According to a post from Microsoft VB.Net Team,

"Currently, DataSet won't be able to use those information. You can
define
enumerations, but those will only be useful when you validate XML
files with
the schema file, but won't be used in a DataSet."

I've personally decided to use the XMLDocument (DOM) object to
traverse my enumerations, for instance, to populate dropdown menus
(comboboxes). Developers just getting started with pure XML and XSD
should realize that the XSD is itself an XML document that can easily
be traversed in a DOM object (in Java, .Net, etc) and used to populate
GUI objects. In my specialty, Law Enforcement, we work with a ton of
lookup tables in our database. So moving to XSD and using it as a
static database for my GUI controls as well as web services validation
was a natural!

Norm

see:
Message 2 in thread
From: VBDotNet Team [MS] (vb******@microsoft.com)
Subject: Re: Typed DataSet and Enumerations
View this article only
Newsgroups: microsoft.public.dotnet.framework.windowsforms.dat abinding
Date: 2002-12-09 13:37:35 PST
"Oleg Ogurok" <ol**@ogurok.com.ihatespammers.ireallydo.co> wrote in message news:<10*************@corp.supernews.com>...
Hi all,

I've added a new DataSet (xsd file) to my project in VS.NET 2003.
There I create a simple type as an enumeration of values.

<xs:simpleType name="MyCustomType">
<xs:restriction base="xs:string">
<xs:enumeration value="Apple" />
<xs:enumeration value="Orange" />
</xs:restriction>
</xs:simpleType>

However, when I compile the project, the .cs file generated for the DataSet
by VS.NET doesn't convert MyCustomType into an "enum" structure. The tpe
remains System.String. Is this the normal behavior?

-Oleg.

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Duncan Welch | last post: by
1 post views Thread by Andre Ranieri | last post: by
2 posts views Thread by =?Utf-8?B?UGV0ZXI=?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
2 posts views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.