DataContext.SubmitChanges Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Include Protected Members
Include Inherited Members

Include Silverlight Members
Include Silverlight for Windows Phone Members
Include XNA Framework Members

Computes the set of modified objects to be inserted, updated, or deleted, and executes the appropriate commands to implement the changes to the database.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

Overload List

  Name Description
Public methodSupported by Silverlight for Windows Phone SubmitChanges() Computes the set of modified objects to be inserted, updated, or deleted, and executes the appropriate commands to implement the changes to the database.
Public methodSupported by Silverlight for Windows Phone SubmitChanges(ConflictMode) Sends changes that were made to retrieved objects to the underlying database, and specifies the action to be taken if the submission fails.

Top

Remarks

If override methods are present for insert, update, or delete, SubmitChanges executes these methods instead of the default LINQ to SQL commands.

SubmitChanges starts a transaction and will roll back if an exception occurs while SubmitChanges is executing. However, this does not roll back the changes in memory or tracked by the DataContext; those changes will need to be rolled back manually. You can start with a new instance of the DataContext if the changes in memory are to be discarded.

For information about using a local database in your Windows Phone application, see Local Database Overview for Windows Phone.