Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SaveChanges Method (Boolean)
Collapse the table of content
Expand the table of content

ObjectContext.SaveChanges Method (Boolean)

Note: This API is now obsolete. The non-obsolete alternative is SaveChanges.

Persists all updates to the data source and optionally resets change tracking in the object context.

Namespace:  System.Data.Objects
Assembly:  System.Data.Entity (in System.Data.Entity.dll)

<BrowsableAttribute(False)> _
<ObsoleteAttribute("Use SaveChanges(SaveOptions options) instead.")> _
Public Function SaveChanges ( _
	acceptChangesDuringSave As Boolean _
) As Integer


Type: System.Boolean

This parameter is needed for client-side transaction support. If true, the change tracking on all objects is reset after SaveChanges(Boolean) finishes. If false, you must call the AcceptAllChanges method after SaveChanges(Boolean).

Return Value

Type: System.Int32
The number of objects in an Added, Modified, or Deleted state when SaveChanges was called.


An optimistic concurrency violation has occurred.

Call the SaveChanges(SaveOptions) method instead.

.NET Framework

Supported in: 3.5 SP1
Obsolete (compiler warning) in 4.6
Obsolete (compiler warning) in 4.6
Obsolete (compiler warning) in 4.5
Obsolete (compiler warning) in 4.5.1
Obsolete (compiler warning) in 4.5.2
Obsolete (compiler warning) in 4

.NET Framework Client Profile

Obsolete (compiler warning) in 4
© 2015 Microsoft