RelationalSyncProvider.DbConnectionFailure Event
Occurs when the database connection fails during change application.
Assembly: Microsoft.Synchronization.Data (in Microsoft.Synchronization.Data.dll)
The following example shows the DbConnectionFailure event handler. This event handler checks the number of retry attempts and overrides the default to retry the change application 10 times before stopping synchronization.
static void HandleDbConnectionFailure(object sender, DbConnectionFailureEventArgs e) { // Override the default to retry 10 times before fail. if (e.RetryCount < 10) { e.Action = DbConnectionFailureAction.RetrySync; } else { e.Action = DbConnectionFailureAction.AbortSync; } }
Private Shared Sub HandleDbConnectionFailure(ByVal sender As Object, ByVal e As DbConnectionFailureEventArgs) ' Override the default to retry 10 times before fail. If e.RetryCount < 10 Then e.Action = DbConnectionFailureAction.RetrySync Else e.Action = DbConnectionFailureAction.AbortSync End If End Sub
Show: