Your changes are not transmitted to the server until you explicitly call Submit Changes on the Data Context.
My only outstanding question with this: If I’m calling ‘Submit Changes’ clearly I’m wanting to update some values and LINQ knows what classes (Tables) I’m working with at the time – So why is there no check to ensure that a PK is in place – Which should then result in an exception being thrown…answers on a comment please !
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site.
Over the last few weeks I've been writing a series of blog posts that cover LINQ to SQL.
LINQ to SQL is a built-in O/RM (object relational mapper) that ships in the .
NET applications and even more years of professional experience using Microsoft development technologies such as ASP, Visual Basic, and SQL Server.
I have worked in several markets such as insurance, real estate, leasing, medical, hospitality, among many others.If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site. There's a difference between adding the object to the data context (and propagating it back to the database) and adding it to the associated entity collection of an object you've retrieved from the database.Below is a class model created for the Northwind sample database and which I'll be using in this blog post: When we designed our data model using the LINQ to SQL data designer above we defined five data model classes: Product, Category, Customer, Order and Order Detail.The properties of each class map to the columns of a corresponding table in the database.Having checked my connection string to ensure I was connecting to the right database, and also checking that I was viewing the same database in SQL Server management studio when checking the value, some research was in order.