UpgradePublicTracking Method
Upgrades tracking metadata in a SP2 database, on which tracking has been enabled, for use by Microsoft Sync Framework Service Pack 1 (SP1) and later versions of Sync Framework.
Namespace: System.Data.SqlServerCe
Assembly: System.Data.SqlServerCe (in System.Data.SqlServerCe.dll)
Syntax
'Declaration
Public Shared Function UpgradePublicTracking ( _
connectionString As String _
) As Boolean
'Usage
Dim connectionString As String
Dim returnValue As Boolean
returnValue = SqlCeChangeTracking.UpgradePublicTracking(connectionString)
public static bool UpgradePublicTracking(
string connectionString
)
public:
static bool UpgradePublicTracking(
String^ connectionString
)
static member UpgradePublicTracking :
connectionString:string -> bool
public static function UpgradePublicTracking(
connectionString : String
) : boolean
Parameters
- connectionString
Type: System. . :: . .String
A connection string to the data source.
Return Value
Type: System. . :: . .Boolean
true if the database was successfully upgraded or if the database is not currently being tracked; otherwise, false.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | connectionString is null Nothing nullptr unit a null reference (Nothing in Visual Basic) . |
Remarks
The upgrade of the sync metadata from Sync Framework 1.0 to Sync Framework 1.0 SP1 is done in two stages.
The first stage happens automatically when Service Pack 2 (SP2) opens a SQL or a Service Pack 1 (SP1) database that is being used by Sync FX 1.0. When this occurs, on tables being tracked the change tracking columns are upgraded and the context column (__sysTrackingContext) is added.
The first time that Sync Framework 1.0 SP1 or a later version of Sync Framework needs to use a or SP1 database, the UpgradePublicTracking method must be called. The UpgradePublicTracking method will create new tables called __SyncArticles and __SyncSubscriptions and will move the data from the __sysSyncArticles and __sysSyncSubscriptions tables into these new tables.
Note
The new tables, __SyncArticles and __SyncSubscriptions, are user tables, not system tables.
If a database contains the __sysSyncArticles and __sysSyncSubscriptions tables then it is compatible with Sync Framework 1.0 and earlier versions. In this case, the UpgradePublicTracking method must be called to upgrade the tracking metadata.