SqlCeConnection.FlushFailure Event

Occurs when the background flush fails.

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

public event SqlCeFlushFailureEventHandler FlushFailure

The following example shows how to use the FlushFailure event.

// using System;
// using System.Xml;
// using System.Data;
// using System.Data.SqlServerCe;
// using System.Data.Common;
// using System.Windows.Forms;
/// <summary>
/// Demonstrates the usage of the FlushFailure event
/// </summary>
public class MyForm : Form
	public void Snippet4()
		SqlCeConnection conn = new SqlCeConnection();
		conn.FlushFailure+=new SqlCeFlushFailureEventHandler(conn_FlushFailure);

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

	void conn_FlushFailure(object sender, SqlCeFlushFailureEventArgs e)
		SqlCeErrorCollection errors = e.Errors;
		Console.WriteLine("Flush Failure:" + errors[0].Message);