Wednesday, May 13, 2009

What is a Typed Dataset in ADO.NET?

Typed DataSet - When a created DataSet derives from the DataSet class, that applies the information contained in the XSD to create a Typed class, this DataSet is said to be a Typed Dataset. Information from the schema which comprises the tables, columns, and rows is created and compiled to a new DataSet derived from the XSD. The Typed DataSet class features all functionality of the DataSet class. This may be used with methods that take an instance of the DataSet class as a parameter.

Note that an UnTyped DataSet does not have any schema. It is exposed simply as a mere collection.
How to create a Typed DataSet?
Write click your project in the Solution Explorer.Click Add New Item.Select DataSet.This adds a new XSD to the project. The schema created may be viewed as an XML. When this xsd file is compiled, two files are created by Visual Studio. The first file that contains the .vb or .cs extension contains the information about the proxy class. This class contains methods & properties that are required to access the database data. The second file has an extension xsx and this contains information about the layout of the XSD.

No comments:

Bookmark and Share