What is a strongly typed dataset?
Asked Answered
R

4

8

What is a strongly typed dataset? (.net)

Roose answered 28/10, 2008 at 12:27 Comment(0)
I
17

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.

Illaffected answered 28/10, 2008 at 12:29 Comment(1)
This is not entirely correct. The dataset has types for the tables and the types have properties to the tables columns. Nitpicking... :-)Migration
C
3

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

Counterword answered 28/10, 2008 at 12:29 Comment(0)
E
3

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.

Eddie answered 28/10, 2008 at 12:37 Comment(1)
@Seiti - that was one example. DbLinq and EF both target multiple databases, as will LINQ-to-NHibernate when it arrives.Eddie
D
2

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.

Durrell answered 28/10, 2008 at 12:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.