Typed vs Untyped DataSets

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.

Who is Participating?

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

Massiel_VBCommented: 2002-07-29

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.