Enumerations in a strongly typed DataSet

O

Oleg Ogurok

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.
 
N

Norman Katz

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] ([email protected])
Subject: Re: Typed DataSet and Enumerations
View this article only
Newsgroups: microsoft.public.dotnet.framework.windowsforms.databinding
Date: 2002-12-09 13:37:35 PST
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top