A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.microsoft.com/en-us/dotnet/api/system.data.linq.datacontext.submitchanges below:

DataContext.SubmitChanges Method (System.Data.Linq) | Microsoft Learn

DataContext.SubmitChanges Method Definition

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

Overloads 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.

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:
 void SubmitChanges();
public void SubmitChanges();
member this.SubmitChanges : unit -> unit
Public Sub SubmitChanges ()
Remarks

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

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.

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)
Parameters Examples
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)
Remarks

Default failure mode is FailOnFirstConflict.

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this article

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4