What is the basic difference between Dataset and Typed Dataset ?

When would you use Typed dataset?

Showing Answers 1 - 18 of 18 Answers

Karthik D V

  • Apr 16th, 2007
 

Typed DataSet is precompiled one

For Example in Normal DataSet this is how we use to get data.

 ds.Tables["Employee"].Rows[0][0]

In typed DataSet usage is strongly bound.

ds.EmployeeTable.Rows[0].EmpIdColumn 

Here every thing is typed, no need to use index/name to identify table or column name.

Typed dataset yields less errors than mornal dataset in all the way.

Typed Dataset is faster than the normal dataset .

The problem of typed dataset is dynamic behaviour
(This is also possible if we build typed dataset on the fly, usingm reflection)

  Was this answer useful?  Yes

Amit kulshrestha

  • Jun 14th, 2007
 

As all of us know, we can specify the Data type when we create a DataColumn for a DataTable. This is to enforce the runtime Type-safety for the column so that only data of specified data type can be stored in the column. In the same way, in most of the cases we prefer to make a DataSet itself as Type-safe so as to protect it from runtime mismatch. Hence Typed DataSets generate classes that expose each object there in the DataSet in Type-safe manner. These classes inherits directly from DataSet class.

  Was this answer useful?  Yes

Urvil Shah

  • Jun 20th, 2007
 

TypeDataSet - You have to define the type of the column when creating the TypeDataset. It is useful when you know the type of the data retrieved from database. You can use type dataset as the business entity. It is physically available. Developed at design time. Performance is issue when you implement SOA.

Dataset - It is normal dataset. created runtime. No need to worry about the type. Any type of data you can fill it. Creates all the column dynamically.

A typed dataset uses .xsd file i.e. the XML file to get information about the tables & columns. So we can use the table names & column names directly. We can derive a new dataset from a typed dataset.

In a general dataset, the tables & columns are exposed as collections & we have to make use of them.

 

e.g. consider a dataset 'ds' having a table 'emp' with a column 'eid' & we want to retrive the 1st record.

in typed dataset:- ds.emp(0).eid

in dataset:- ds.tables("emp")(0).columns("eid")

syed1ahmad

  • Jul 12th, 2008
 

Typed dataset is design time concept and it is type safe mechanish.
typed dataset field can be accessed as properties programatically.

Typed Dataset is more faster as compated to the normal dataset 'coz of the type casting is not required.

albu77

  • Jun 1st, 2009
 

With normal dataset you have to always have in mind the schema of your source of data.
Typed dataset are a generated class derived from the dataset and in which every thing from the schema is included in the types generated. So when you use the typed dataset, you have full help from Intellisense and you avoid a lot of compilation and execution errors.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions