Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
FlushFailure Event
Collapse the table of content
Expand the table of content

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);

		conn.Open();
		
		//Flush failure occurs here
		//OnFlushFailure will be called from the background thread.

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


Show:
© 2015 Microsoft