views:

688

answers:

6

What is a strongly typed dataset? (.net)

+2  A: 

Short answer: A dataset which is guaranteed (by the compiler) to hold a specific type.

Rik
+13  A: 

A strongly typed dataset is one that has specific types for the tables and their columns.

You can say

EmployeeDataset ds = ...
EmployeeRow row = ds.Employees.Rows[0];
row.Name = "Joe";

instead of:

DataSet ds = ...
DataRow row = ds.Tables["Employees"].Rows[0];
row["Name"] = "Joe";

This helps because you catch mistakes in naming at compile time, rather than run time and also enforces types on columns.

rslite
This is not entirely correct. The dataset has types for the tables and the types have properties to the tables columns. Nitpicking... :-)
Rune Grimstad
A: 

A dataset which is tightly to a specific table at compile time so you can access the columns of a table using actual column name instead of index.

+2  A: 

MSDN

Ady
A: 

It looks like DataSet has already been covered, but for completeness, note that in .NET 3.5 there are good alternatives for simple data access; in particular, things like LINQ to SQL. This has a similar objective, but retains a much purer simple OO model to your data classes.

Marc Gravell
Unfortunately, LINQ to SQL means LINQ to SQL Server...
Seiti
@Seiti - that was one example. DbLinq and EF both target multiple databases, as will LINQ-to-NHibernate when it arrives.
Marc Gravell
A: 

A headache...

Sorry... I've been struggling with this beast for a while.. For this reason.

Seiti