473,500 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5596
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2089
by: | last post by:
We have an object factory that returns weakly typed datasets (just plain ol' DataSet's). I need to cast it, or transform it, or map it to a strongly typed dataset. There's an old adage I heard...
2
2846
by: theWizK | last post by:
Hello all. I have noticed that when I generate a strongly-typed dataset from an xml schema that the DataTables that are generated have their constructors marked as internal. What this means is...
1
6056
by: Job Lot | last post by:
I am confused how strongly typed dataset is different from un-typed dataset. Is there any good link explaining pros and cons of both? Which one should be used preferably?
3
5430
by: Duncan Welch | last post by:
I have a strongly typed dataset that returns two tables - "items" and "itemdetails". In the strongly-typed dataset designer, I've created a link (relationship) between the two tables based on a...
2
4358
by: David | last post by:
I have been developing applications with Java for quite a while but I am new to .NET development. I am trying to learn the ".NET way" of creating Strongly Typed Objects from a database. The...
1
2160
by: HardBap | last post by:
I've created a strongly typed DataSet (Customers.xsd) using the xsd.exe tool. I want to be able to access fields using ds.Customer.CompanyName. The problem is when I return this DataSet from a...
1
1488
by: Andre Ranieri | last post by:
I'm designing an extranet web site that customers will use to log in and see their account history, make payments against their balance, etc. I've declared a strongly typed DataSet as a public...
2
1687
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
When I'm debugging a Windows Forms Application in VS2005 IDE, how can I check whether a dataset is strongly typed or not in Watch window? Are there some properties or methods only exist for...
4
3089
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 ...
0
7136
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
7018
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
7232
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...
1
6906
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7397
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5490
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
316
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.