October 2010
Intermediate to advanced
1920 pages
73h 55m
English
You can update a LINQ to SQL entity and the underlying database table by modifying the entity’s properties and calling the DataContext's SubmitChanges() method, like this:

This code first grabs the movie that has an Id value of 1. Next, the movie Title and Director properties are modified. Finally, these changes are submitted to the database by calling the SubmitChanges() method.
This code works, but it is not the best code to use when building an ASP.NET page. Typically, when performing an update in ASP.NET, you already have information about the entity in view state. You don’t want or need to grab the entity from the ...