Export (0) Print
Expand All

SqlSyncStoreRestore Class

Sync Framework 2.0

Represents operations that must occur after a SQL Server database is restored from a backup.

Namespace: Microsoft.Synchronization.Data.SqlServer
Assembly: Microsoft.Synchronization.Data.SqlServer (in microsoft.synchronization.data.sqlserver.dll)

public class SqlSyncStoreRestore
public class SqlSyncStoreRestore
public class SqlSyncStoreRestore

Use this class after you have restored a SQL Server database that is involved in synchronization. For more information, see How to: Backup and Restore a Database (SQL Server).

The following code example restores a server database by calling one of the sample Utility methods, and then calls PerformPostRestoreFixup to update metadata. To view this code in the context of a complete application, see How to: Backup and Restore a Database (SQL Server).

Utility.RestoreDatabaseFromBackup();


// Call the API to update synchronization metadata to reflect that the database was
// just restored. The restore stored procedure kills the connection to the
// server, so we must re-establish it.
SqlConnection.ClearPool(serverConn);
serverConn = new SqlConnection(Utility.ConnStr_SqlSync_Server);
SqlSyncStoreRestore databaseRestore = new SqlSyncStoreRestore(serverConn);
databaseRestore.PerformPostRestoreFixup();

System.Object
  Microsoft.Synchronization.Data.SqlServer.SqlSyncStoreRestore

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2015 Microsoft