Getting Started with LINQ to SQL

To start with LINQ to SQL, launch VS, right-click your sample project in Solution Explorer, and then choose Add New Item. Click the Data folder on the left side of the ensuing dialog and then select the LINQ to SQL Classes item on the right. Name your new file AdventureWorks2012 and click OK (illustrated in Figure 47.4).

Image

FIGURE 47.4 Adding a LINQ to SQL classes file to your WPF sample application.

After your new .dbml file is created in your project, VS’s Object/Relational (O/R) Designer opens up with its blank surface ready. On this surface, you add C# data classes that mirror the tables and relationships in ...

Get Microsoft® SQL Server 2012 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.