次の方法で共有


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 オブジェクトを使用すると、失敗の原因となったエラーまたは競合に関する情報が提供されます。イベントのハンドラーで、同期プロバイダーが行の適用を再試行するかどうかの指定など、いくつかの方法でイベントに応答できます。詳細については、「イベントを操作する方法とビジネス ロジックをプログラムする方法」および「データの競合とエラーを処理する方法」を参照してください。

次のコード例では、ApplyChangeFailed イベントのイベント ハンドラーを指定します。呼び出されたメソッドは、クライアント同期プロバイダーとサーバー同期プロバイダーの情報をそれぞれ異なるログ ファイルに記録します。完全なコンテキスト例でこのコードを表示するには、「セッション変数を使用する方法」を参照してください。

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

スレッド セーフ

この型の public static (Visual Basic では Shared) のメンバーはスレッド セーフです。インスタンス メンバーの場合は、スレッド セーフであるとは限りません。

参照

参照

ApplyChangeFailedEventArgs メンバー

Microsoft.Synchronization.Data 名前空間