Connecting Tech Pros Worldwide Help | Site Map

Enumerations in a strongly typed DataSet

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 15th, 2005, 07:56 PM
Oleg Ogurok
Guest
 
Posts: n/a
Default 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.



  #2  
Old November 15th, 2005, 09:35 PM
Norman Katz
Guest
 
Posts: n/a
Default 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]
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.