Using LINQ to SQL - Part 1
page 3 of 6
by Scott Guthrie
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 30435/ 80

Understanding the DataContext Class

When you press the "save" button within the LINQ to SQL designer surface, Visual Studio will persist out .NET classes that represent the entities and database relationships that we modeled.  For each LINQ to SQL designer file added to our solution, a custom DataContext class will also be generated.  This DataContext class is the main conduit by which we'll query entities from the database as well as apply changes.  The DataContext class created will have properties that represent each Table we modeled within the database, as well as methods for each Stored Procedure we added.

For example, below is the NorthwindDataContext class that is persisted based on the model we designed above:

Figure 2

View Entire Article

User Comments

Title: images not visible   
Name: Dhriti
Date: 2013-02-06 6:02:23 AM
images are not visible.
Title: Image Not Visible   
Name: Manish Prasad
Date: 2012-09-04 1:29:48 AM
Images are not Visible in the Article(, Please Do the Needful

Title: thanks buddy   
Name: pravy
Date: 2009-12-30 6:54:36 AM
very help full ..... upload some more articles
Title: Developer 1   
Name: SL
Date: 2009-09-29 7:21:21 AM
Good Article
Title: Developer   
Name: SL
Date: 2009-05-11 10:16:51 AM
Very short and simple understanding article for a novice. XCellent..

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-05-28 9:34:26 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search