RdaTrackOption Enumeration

Specifies whether or not the table being pulled to the device is tracked.

Namespace: System.Data.SqlServerCe
Assembly: System.Data.SqlServerCe (in system.data.sqlserverce.dll)

Syntax

'Declaration
Public Enumeration RdaTrackOption
public enum RdaTrackOption
public enum class RdaTrackOption
public enum RdaTrackOption
public enum RdaTrackOption

Members

Member name Description
TrackingOff Indicates that SQL Server Compact 3.5 SP1 does not track changes to the pulled table. No PRIMARY KEY constraints are created locally.
TrackingOffWithIndexes Indicates that SQL Server Compact 3.5 SP1 does not track changes to the pulled table. Indexes and PRIMARY KEY constraints that existed on the SQL Server table specified in sqlSelectString are created on the local table.
TrackingOn Indicates that SQL Server Compact 3.5 SP1 tracks all changes to the pulled table. PRIMARY KEY constraints related to the value specified for sqlSelectString are created on the local table. This is the default setting.
TrackingOnWithIndexes Indicates that SQL Server Compact 3.5 SP1 tracks all changes to the pulled table. Indexes and PRIMARY KEY constraints that existed on the SQL Server table specified in sqlSelectString are created on the local table.

Remarks

This property specifies whether SQL Server Compact 3.5 SP1 will track changes to the pulled table. You can specify TrackingOn or TrackingOnWithIndexes to update the pulled table on the smart device first, and then push changed records back to the original SQL Server table. When TrackingOn is specified, PRIMARY KEY constraints are created on the pulled table. When TrackingOnWithIndexes is specified, PRIMARY KEY constraints and related indexes are created on the pulled table.

Note

An index will be created only if the column (or columns) that make up the index is pulled.

In both cases, SQL Server Compact 3.5 SP1 keeps track of every record that is inserted, updated, or deleted in the local table.

When the application calls the Push method, SQL Server Compact 3.5 SP1 uses the change tracking information to locate the inserted, updated, and deleted records in the local SQL Server Compact 3.5 SP1 table and propagate these changes back to SQL Server.

The following restrictions apply when RdaTrackOption is set to TrackingOn or TrackingOnWithIndexes:

  • An error occurs if the SELECT statement returns a nonupdatable recordset.

  • A primary key must be defined on the updatable recordset returned by the SELECT statement.

  • The SELECT statement can reference a view or stored procedure, but the view or stored procedure must reference only one table and must be updatable.

  • When TrackingOnWithIndexes is specified, indexes that exist on the SQL Server table and are relevant to the columns specified in the sqlSelectString argument of the Pull method are created against the SQL Server Compact 3.5 SP1 local table as specified in the localTableName argument of Pull.

The errorTableName property specifies the name of the table in which Push errors should be stored. If an error arises when the application calls the Push method, SQL Server Compact 3.5 SP1 creates the error table and inserts a record in the table for each error that occurs. When the Push method completes, the application can examine the error table to determine whether errors have occurred. errorTableName can be specified only when TrackingOn or TrackingOnWithIndexes is specified. For more information about how the error table works in RDA, see "Remote Data Access (RDA) Conflict Detection and Resolution" in the SQL Server Compact 3.5 SP1 Books Online.

Platforms

Development Platforms

Windows Vista, Windows Mobile 5.0, Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Mobile 2003 for Pocket PC, Windows CE 5.0
Version Information
.NET Framework and NET Compact Framework
Supported in 3.5
.NET Framework
Supported in 3.0
.NET Compact Framework and .Net Framework
Supported in 2.0

See Also

Reference

System.Data.SqlServerCe Namespace
Pull