SqlConnection.InfoMessage Event

Occurs when SQL Server returns a warning or informational message.

Namespace: System.Data.SqlClient
Assembly: System.Data (in system.data.dll)

event SqlInfoMessageEventHandler^ InfoMessage {
	void add (SqlInfoMessageEventHandler^ value);
	void remove (SqlInfoMessageEventHandler^ value);

/** @event */
public void add_InfoMessage (SqlInfoMessageEventHandler value)

/** @event */
public void remove_InfoMessage (SqlInfoMessageEventHandler value)

JScript supports the use of events, but not the declaration of new ones.

Clients that want to process warnings or informational messages sent by the server should create an SqlInfoMessageEventHandler delegate to listen to this event.

The InfoMessage event occurs when a message with a severity of 10 or less is returned by SQL Server. Messages that have a severity between 11 and 20 raise an error and messages that have a severity over 20 causes the connection to close. For more information on SQL Server error levels, see "Database Engine Error Severities" in SQL Server 2005 Books Online.

For more information and an example, see Working with Connection Events.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0