O'Reilly logo

Pro LINQ: Language Integrated Query in C# 2008 by Joseph C. Rattz Jr.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

[Your]DataContext Class

While I haven't covered it yet, one of the LINQ to SQL classes you will frequently use is the System.Data.Linq.DataContext class. This is the class you will use to establish your database connection. When creating or generating entity classes, it is common for a class to be created that derives from the DataContext class. This derived class will typically take on the name of the database it will be connecting to. Since I am using the Northwind database for the examples in this chapter, my derived database class will be named Northwind. However, since the name of the derived class changes with the database being used, the name of the class will vary from code to code. For ease of reference in the LINQ to SQL chapters, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required