Solved

Typed vs Untyped DataSets

Posted on 2002-07-26
6
1,056 Views
Last Modified: 2008-03-17
What are the pro's and con's of typed vs untyped DataSets when used with Web Services?   This is related to my other post regarding slow client performance when creating the web service proxy object.  I'm wondering if
having each web method return an untyped DataSet would result in a smaller proxy object on the client.

In our case, currently each typed DataSet encapsulates a single DataTable. We use the DataSet for both and update/insert/delete operations.

0
Comment
Question by:wile_e_coyote
6 Comments
 
LVL 23

Expert Comment

by:naveenkohli
ID: 7181295
The biggest advantage that typed datasets provide is the what the description says.. It is strongly typed. What that means is that instead of accessing fields or tables through generic data objects like DataTable, Row[0] etc, you will accessing information through properties on the strongly typed data set classes. This avoids lot of run time errors that can happen due to misspeliings or wrong indices of columns being accessed. This definitely gives lot of advantages by providing compile type error checking.

The only disadvantage i can think of this that if the schema of your table changes, then you will have to recreate the class and compile the code again.
0
 

Expert Comment

by:Massiel_VB
ID: 7186332
From MSDN:

Datasets can be typed or untyped. A typed dataset is a dataset that is first derived from the base DataSet class and then uses information in an XML Schema file (an .xsd file) to generate a new class. Information from the schema (tables, columns, and so on) is generated and compiled into this new dataset class as a set of first-class objects and properties.

Because a typed DataSet class inherits from the base DataSet class, the typed class assumes all of the functionality of the DataSet class and can be used with methods that take an instance of a DataSet class as a parameter

An untyped dataset, in contrast, has no corresponding built-in schema. As in a typed dataset, an untyped dataset contains tables, columns, and so on — but those are exposed only as collections. (However, after manually creating the tables and other data elements in an untyped dataset, you can export the dataset's structure as a schema using the dataset's WriteXmlSchema method.)

You can use either type of dataset in your applications. However, Visual Studio has more tool support for typed datasets, and they make programming with the dataset easier and less error-prone.

0
 
LVL 4

Author Comment

by:wile_e_coyote
ID: 7193485
naveenkohli and Massiel_VB

These are both good answers - how about splitting the points?  (You'll each get 25 points)
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 23

Expert Comment

by:naveenkohli
ID: 7193520
sounds good :-)
0
 
LVL 4

Author Comment

by:wile_e_coyote
ID: 7199374
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 7199441
Points refunded and question closed.

Netminder
CS Moderator
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now