Behind the Scenes of LINQ to SQL Classes

The Visual Studio 2010 IDE generates LINQ to SQL classes invoking a command-line tool named SQLMetal.exe that is part of the Windows SDK for .NET Framework. The following is an example of the command line for performing a manual generation of LINQ to SQL classes for the Northwind database and Visual Basic:

SQLMetal.exe /Server:.SQLExpress /DataBase:Northwind /dbml:Northwind.dbml
/language:VisualBasic

Of course, SQLMetal.exe offers other command-line options for generating LINQ to SQL classes, but in most cases you do not need such manual generation, because the IDE will do all the appropriate work for you. There is only one scenario when you need to manually create a LINQ to SQL class, which is when mapping SQL Server Compact Edition databases and that is discussed at the end of this chapter. For further information on SQLMetal, visit the official page on MSDN: http://msdn.microsoft.com/enus/library/bb386987(VS.100).aspx.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.169.40