473,780 Members | 2,137 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:simpleTyp e name="MyCustomT ype">
<xs:restricti on base="xs:string ">
<xs:enumerati on value="Apple" />
<xs:enumerati on 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 5611
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******@micro soft.com)
Subject: Re: Typed DataSet and Enumerations
View this article only
Newsgroups: microsoft.publi c.dotnet.framew ork.windowsform s.databinding
Date: 2002-12-09 13:37:35 PST
"Oleg Ogurok" <ol**@ogurok.co m.ihatespammers .ireallydo.co> wrote in message news:<10******* ******@corp.sup ernews.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:simpleTyp e name="MyCustomT ype">
<xs:restricti on base="xs:string ">
<xs:enumerati on value="Apple" />
<xs:enumerati on 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
2110
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 from a Microsoft developer a long time ago: If it's taking more than 10 lines of code, then you are doing it wrong. Is there an *easy* way to do this in a *generic* way? I have been experimenting with serveral techniques and
2
2889
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 when I try to instantiate one of the strongly-typed tables from this dataset from a different assembly, I cannot. Let me provide examples... If I have a simple dataset like this:
1
6089
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
5443
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 foreign key. I want to put them into a nested repeater, but I'm having problems finding a "nice" way of doing it. Can someone please point me in the direction of a tutorial or best practice to achieve this?
2
4375
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 Enterprise Library seems pretty close to what I am used to in Java but I am not sure how to create strongly-typed DataSets. I see that I can use the LoadDataSet method from a Microsoft.Practices.EnterpriseLibrary.Data.Database but I am not clear on how...
1
2183
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 Web Service it adds another Table to the DataSet that contains the data. I have to access the data using ds.Tables.Rows.ToString(). This defeats the whole purpose of using a strongly typed DataSet. Thanks in advance for the help.
1
1505
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 static object in the main accounts page - "public Customer.DataSet dsMyData = new Customer.DataSet();" and populate the tables with information about the account, services, etc which are referenced from the other pages as such: lblEMail.Text =...
2
1699
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 strongly typed dataset?
4
3112
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 comparisions) cleared? Thanks, Rachana
0
9636
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9931
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8961
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6727
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.