Export (0) Print
Expand All

SqlCeConnection.FlushFailure Event

Occurs when the background flush fails.

Namespace:  System.Data.SqlServerCe
Assembly:  System.Data.SqlServerCe (in System.Data.SqlServerCe.dll)

Public Event FlushFailure As SqlCeFlushFailureEventHandler
Dim instance As SqlCeConnection
Dim handler As SqlCeFlushFailureEventHandler

AddHandler instance.FlushFailure, handler

The following example shows how to use the FlushFailure event.

    Public Sub Snippet4()
        Dim conn As SqlCeConnection = Nothing

            conn = New SqlCeConnection("Data Source = MyDatabase.sdf; Password ='<pwd>'")

			AddHandler conn.FlushFailure, AddressOf conn_FlushFailure


			'Flush failure occurs here
			'OnFlushFailure will be called from the background thread.

        End Try

    End Sub

	Private Sub conn_FlushFailure(ByVal sender As System.Object, ByVal e As SqlCeFlushFailureEventArgs)
		Dim errors As SqlCeErrorCollection = e.Errors
        Console.WriteLine("Flush Failure: " + errors(0).Message)

    End Sub

© 2014 Microsoft