Solved

Typed vs Untyped DataSets

Posted on 2002-07-26
6
1,065 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

730 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