Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Ruft ein Exception-Objekt ab, das Metadaten über Ausnahmen enthält, die während der Synchronisierung aufgetreten sind.
Namespace: Microsoft.Synchronization.Data
Assembly: Microsoft.Synchronization.Data (in Microsoft.Synchronization.Data.dll)
Syntax
'Declaration
Public ReadOnly Property Error As Exception
Get
'Usage
Dim instance As DbApplyChangeFailedEventArgs
Dim value As Exception
value = instance.Error
public Exception Error { get; }
public:
property Exception^ Error {
Exception^ get ();
}
member Error : Exception
function get Error () : Exception
Eigenschaftenwert
Typ: System. . :: . .Exception
Ein Exception-Objekt, das Metadaten über Ausnahmen enthält, die während der Synchronisierung aufgetreten sind.
Beispiele
Im folgenden Codebeispiel werden Fehlerinformationen in eine Protokolldatei geschrieben.
else if (e.Conflict.Type == DbConflictType.ErrorsOccurred)
{
string logFile = @"C:\SyncErrorLog.txt";
Console.WriteLine(String.Empty);
Console.WriteLine("An error occurred during synchronization.");
Console.WriteLine("This error has been logged to " + logFile + ".");
StreamWriter streamWriter = File.AppendText(logFile);
StringBuilder outputText = new StringBuilder();
outputText.AppendLine("** APPLY CHANGE FAILURE AT " + DbConflictDetected.ToUpper() + " **");
outputText.AppendLine("Error source: " + e.Error.Source);
outputText.AppendLine("Error message: " + e.Error.Message);
streamWriter.WriteLine(DateTime.Now.ToShortTimeString() + " | " + outputText.ToString());
streamWriter.Flush();
streamWriter.Dispose();
}
ElseIf e.Conflict.Type = DbConflictType.ErrorsOccurred Then
Dim logFile As String = "C:\SyncErrorLog.txt"
Console.WriteLine(String.Empty)
Console.WriteLine("An error occurred during synchronization.")
Console.WriteLine("This error has been logged to " & logFile & ".")
Dim streamWriter As StreamWriter = File.AppendText(logFile)
Dim outputText As New StringBuilder()
outputText.AppendLine("** APPLY CHANGE FAILURE AT " & DbConflictDetected.ToUpper() & " **")
outputText.AppendLine("Error source: " & e.Error.Source)
outputText.AppendLine("Error message: " & e.Error.Message)
streamWriter.WriteLine(DateTime.Now.ToShortTimeString() & " | " & outputText.ToString())
streamWriter.Flush()
streamWriter.Dispose()
End If
Siehe auch
Verweis
DbApplyChangeFailedEventArgs Klasse