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

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
Comment:
images are not visible.
Title: Image Not Visible   
Name: Manish Prasad
Date: 2012-09-04 1:29:48 AM
Comment:
Images are not Visible in the Article(http://aspalliance.com/articleViewer.aspx?aId=1330&pId=-1), Please Do the Needful

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






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


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-20 2:06:58 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search