LINQ to SQL with SQL Server Compact Edition

LINQ to SQL is not limited to querying and manipulating data from SQL Server databases, but you can also perform the same operations against SQL Server Compact Edition databases (with .sdf extensions). The only big difference is that generating LINQ to SQL classes for this engine is not supported by the Visual Studio IDE (as it already was in Visual Studio 2008), so you have to perform a couple of steps manually. First, run the Visual Studio command prompt which you can find in Start, All Programs, Microsoft Visual Studio 2010, Visual Studio Tools. When you get the command line, move to the folder where the SQL Compact database is available. For example, you can play with the Northwind database in ...

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.