Sys.Data.MergeOption Enumeration

Used to specify merge behavior when a fetchData request to the server returns entities which are already being tracked for changes by the DataContext.

Namespace: Sys.Data

Inherits: None

var a = Sys.Data.MergeOption.appendOnly;
var b = Sys.Data.MergeOption.overwriteChanges;

Members

Member name

Description

appendOnly

The integer 0 that indicates that the appendOnly mode is used for adding new items. This option preserves any unsaved changes to the current item, rather than overwriting with values obtained from the server.

overwriteChanges

The integer 1 that indicates that the overwriteChanges mode is used for adding new items. This option will overwrite any unsaved changes to the current item, with the values obtained from the server.

Example

The following is an example of how to use Sys.Data.MergeOption Enumeration.

<script type="text/javascript">
var imagesDC = new Sys.Data.AdoNetDataContext();
imagesDC.set_serviceUri("../Services/ImagesDataService.svc");
imagesDC.set_mergeOption(Sys.Data.MergeOption.appendOnly);
imagesDC.initialize();
</script>

See Also

Other Resources

Language Reference