?
Solved

Typed vs Untyped DataSets

Posted on 2002-07-26
6
Medium Priority
?
1,101 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
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

862 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