August 2008
Intermediate to advanced
197 pages
3h 23m
English
In the previous section, you saw how LINQ to SQL supports ADO.NET transactions. This is not the only integration between the "old" ADO.NET library and the "new" LINQ to SQL. In fact, LINQ to SQL can use ADO.NET DataSets with LINQ to DataSet.
With some limitations, LINQ to DataSet allows developers to use DataSets as normal data sources using the usual LINQ query syntax.
Listing 2-27 shows a simple example that uses a LINQ query to fill a typed dataset.
dsPeople ds = new dsPeople(); dsPeople.RoleRow row = ds.Role.NewRoleRow(); row.ID = 1; row.RoleDescription = "Manager"; ds.Role.AddRoleRow(row); row = ds.Role.NewRoleRow(); row.ID = 2; row.RoleDescription ... |
Read now
Unlock full access