Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

Enumerations in a strongly typed DataSet

Question posted by: Oleg Ogurok (Guest) on November 15th, 2005 07:56 PM
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.


Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
Norman Katz's Avatar
Norman Katz
Guest
n/a Posts
November 15th, 2005
09:35 PM
#2

Re: Enumerations in a strongly typed DataSet
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] (vbdotnet@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" <oleg@ogurok.com.ihatespammers.ireallydo.co> wrote in message news:<101t4sue1jcs721@corp.supernews.com>...[color=blue]
> 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.[/color]

 
Not the answer you were looking for? Post your question . . .
173,562 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors