共用方式為


SqlSyncStoreRestore 類別

表示從備份還原 SQL Server 資料庫之後必須進行的作業。

命名空間: Microsoft.Synchronization.Data.SqlServer
組件: Microsoft.Synchronization.Data.SqlServer (在 microsoft.synchronization.data.sqlserver.dll)

語法

'宣告
Public Class SqlSyncStoreRestore
'用途
Dim instance As SqlSyncStoreRestore
public class SqlSyncStoreRestore
public ref class SqlSyncStoreRestore
public class SqlSyncStoreRestore
public class SqlSyncStoreRestore

備註

在您已經還原與同步處理有關的 SQL Server 資料庫之後,請使用這個類別。如需詳細資訊,請參閱 HOW TO:備份和還原資料庫 (SQL Server)

範例

下列程式碼範例會還原伺服器資料庫,方法是呼叫其中一個範例 Utility 方法,然後呼叫 PerformPostRestoreFixup 來更新中繼資料。若要在完整應用程式的內容中檢視這段程式碼,請參閱 HOW TO:備份和還原資料庫 (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();
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)
Dim databaseRestore As New SqlSyncStoreRestore(serverConn)
databaseRestore.PerformPostRestoreFixup()

繼承階層

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

執行緒安全性

任何公用靜態 (共用 在 Visual Basic) 此型別的成員具備執行緒安全。不保證任何執行個體成員安全執行緒。

請參閱

參考

SqlSyncStoreRestore 成員
Microsoft.Synchronization.Data.SqlServer 命名空間