Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Computes the set of modified objects to be inserted, updated, or deleted, and executes the appropriate commands to implement the changes to the database.
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. |
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. |
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.
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:
void SubmitChanges();
public void SubmitChanges();
member this.SubmitChanges : unit -> unit
Public Sub SubmitChanges ()
If override methods are present for insert, update, or delete, SubmitChanges executes these methods instead of the default LINQ to SQL commands.
Product | Versions |
---|---|
.NET Framework | 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Sends changes that were made to retrieved objects to the underlying database, and specifies the action to be taken if the submission fails.
public:
virtual void SubmitChanges(System::Data::Linq::ConflictMode failureMode);
public virtual void SubmitChanges(System.Data.Linq.ConflictMode failureMode);
abstract member SubmitChanges : System.Data.Linq.ConflictMode -> unit
override this.SubmitChanges : System.Data.Linq.ConflictMode -> unit
Public Overridable Sub SubmitChanges (failureMode As ConflictMode)
The action to be taken if the submission fails. Valid arguments are as follows:
Northwnd db = new Northwnd("...");
// Create, update, delete code.
db.SubmitChanges(ConflictMode.FailOnFirstConflict);
// or
db.SubmitChanges(ConflictMode.ContinueOnConflict);
Dim db As New Northwnd("...")
' Create, update, delete code.
db.SubmitChanges(ConflictMode.FailOnFirstConflict)
' or
db.SubmitChanges(ConflictMode.ContinueOnConflict)
Default failure mode is FailOnFirstConflict.
Product | Versions |
---|---|
.NET Framework | 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in