Share via


SqlCeTransaction.TrackingContext Property

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)

Syntax

'Declaration
Public Property TrackingContext As Guid
    Get
    Set
'Usage
Dim instance As SqlCeTransaction
Dim value As Guid

value = instance.TrackingContext

instance.TrackingContext = value
public Guid TrackingContext { get; set; }
public:
property Guid TrackingContext {
    Guid get ();
    void set (Guid value);
}
member TrackingContext : Guid with get, set
function get TrackingContext () : Guid
function set TrackingContext (value : Guid)

Property Value

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

Remarks

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.

See Also

Reference

SqlCeTransaction Class

System.Data.SqlServerCe Namespace

SqlCeChangeTracking

TrackingOptions