共用方式為


ApplyChangeFailedEventArgs 類別

為用戶端 ApplyChangeFailed 事件和伺服器 ApplyChangeFailed 事件提供資料。

命名空間:  Microsoft.Synchronization.Data
組件:  Microsoft.Synchronization.Data (在 Microsoft.Synchronization.Data.dll 中)

語法

'宣告
Public Class ApplyChangeFailedEventArgs _
    Inherits EventArgs
'用途
Dim instance As ApplyChangeFailedEventArgs
public class ApplyChangeFailedEventArgs : EventArgs
public ref class ApplyChangeFailedEventArgs : public EventArgs
type ApplyChangeFailedEventArgs =  
    class
        inherit EventArgs
    end
public class ApplyChangeFailedEventArgs extends EventArgs

備註

如果在同步處理期間無法套用某個資料列,就會引發 ApplyChangeFailed 事件。ApplyChangeFailedEventArgs 物件會提供有關造成失敗之錯誤或衝突的資訊。在此事件的處理常式中,您可以透過幾種方式來回應此事件,其中包括指定同步處理提供者是否應該再次嘗試套用此資料列。如需詳細資訊,請參閱 HOW TO:使用事件和程式商務邏輯HOW TO:處理資料衝突和錯誤

範例

下列程式碼範例會針對 ApplyChangeFailed 事件指定事件處理常式。呼叫的方法會記錄資訊,為用戶端和伺服器同步處理提供者分隔檔案。若要在完整範例的內容中檢視這段程式碼,請參閱 HOW TO:使用工作階段變數

this.ApplyChangeFailed += new EventHandler<ApplyChangeFailedEventArgs>(EventLogger.LogEvents);
else if (e is ApplyChangeFailedEventArgs)
{

    ApplyChangeFailedEventArgs args = (ApplyChangeFailedEventArgs)e;
    outputText.AppendLine("** APPLY CHANGE FAILURE AT " + site.ToUpper() + " **");
    outputText.AppendLine("Table for which failure occurred: " + args.TableMetadata.TableName);
    outputText.AppendLine("Error message: " + args.Error.Message);

}
AddHandler Me.ApplyChangeFailed, AddressOf EventLogger.LogEvents
ElseIf TypeOf e Is ApplyChangeFailedEventArgs Then

    Dim args As ApplyChangeFailedEventArgs = CType(e, ApplyChangeFailedEventArgs)
    outputText.AppendLine("** APPLY CHANGE FAILURE AT " & site.ToUpper() & " **")
    outputText.AppendLine("Table for which failure occurred: " & args.TableMetadata.TableName)
    outputText.AppendLine("Error message: " & args.Error.Message)

繼承階層

System. . :: . .Object
  System. . :: . .EventArgs
    Microsoft.Synchronization.Data..::..ApplyChangeFailedEventArgs

執行緒安全性

這個類型的任何公用static (在 Visual Basic 中為 Shared) 成員都是安全執行緒。不保證任何執行個體成員都可以是安全執行緒。

請參閱

參考

ApplyChangeFailedEventArgs 成員

Microsoft.Synchronization.Data 命名空間