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
2008-10-28 12:29:01
+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
2008-10-28 12:29:45
This is not entirely correct. The dataset has types for the tables and the types have properties to the tables columns. Nitpicking... :-)
Rune Grimstad
2008-11-24 20:25:57
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
2008-10-28 12:37:51
@Seiti - that was one example. DbLinq and EF both target multiple databases, as will LINQ-to-NHibernate when it arrives.
Marc Gravell
2008-11-24 22:12:22