This topic has not yet been rated - Rate this topic

Analyzing LINQ to SQL Source Code

By using the following steps, you can produce LINQ to SQL source code from the Northwind sample database. You can compare elements of the object model with elements of the database to better see how different items are mapped.

noteNote:
Developers using Visual Studio can use the O/R Designer to produce this code. Object Relational Designer (O/R Designer)
Object Relational Designer (O/R Designer)

  1. If you do not already have the Northwind sample database on your development computer, you can download it free of charge. For more information, see Downloading Sample Databases.

  2. Use the SqlMetal command-line tool to generate a Visual Basic or C# source file. For more information, see Code Generation Tool (SQLMetal.exe). By typing the following commands at a command prompt, you can generate Visual Basic and C# source files that include stored procedures and functions:

    • sqlmetal /code:northwind.vb /language:vb "c:\northwnd.mdf" /sprocs /functions /pluralize

    • sqlmetal /code:northwind.cs /language:csharp "c:\northwnd.mdf" /sprocs /functions /pluralize

See Also



Copyright © 2012 by Microsoft Corporation. All rights reserved.


Build Date:

2012-08-02
Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.