SqlCeTransaction.TrackingContext Property

Visual Studio 2010

Gets or sets application-specific context information that is associated by the transaction with tracked operations on a SQL Server Compact database table.

Namespace:  System.Data.SqlServerCe
Assembly:  System.Data.SqlServerCe (in System.Data.SqlServerCe.dll)

public Guid TrackingContext { get; set; }

Property Value

Type: System.Guid
A value that represents application-specific information.

The TrackingContext property can be used to associate application-specific context with a tracked operation on a database table. The transaction applies the value set for TrackingContext in the following situations:

  • When a database operation that is being tracked is performed on a table for which tracking is enabled, the transaction sets the __sysTrackingContext column in the tracked row to the value of TrackingContext.

  • When a row in a tracked table is deleted and delete operations are being tracked on the table, the transaction sets the __sysTrackingContext column on the row when it is moved to the tombstone table (__sysOCSDeletedRows) to the value of TrackingContext.

The tracking infrastructure does not interpret the context value. An application developer can use the value to associate information important to the application with tracked changes; for example, it may be used to associate the user or system that made the change with the tracked data.