System.Data.SqlClient Namespace SqlConnection Class
Occurs when the provider sends a warning or an informational message.
[ VB ]
Public Event InfoMessage As SqlInfoMessageEventHandler
[ C# ]
public event SqlInfoMessageEventHandler InfoMessage;
[ C++ ]
public: __event SqlInfoMessageEventHandler* InfoMessage;
In [ JScript ], you can handle the events defined by a class, but you cannot define your own.
The event handler receives an argument of type SqlInfoMessageEventArgs containing data related to this event. The following SqlInfoMessageEventArgs properties provide information specific to this event.
Property |
Description |
Errors |
Gets the collection of warnings sent from the data source. |
Message |
Gets the full text of the error sent from the data source. |
Source |
Gets the name of the object that generated the error. |
The InfoMessage event fires when a message with low severity is returned from the data source. Low severity messages are those that do not result in an exception. For Microsoft SQL Server, this includes error messages with a severity of 10 or less.
Clients that want to process warnings or informational messages sent by the server should create an SqlInfoMessageEventHandler delegate to listen to this event.
SqlConnection Members SqlInfoMessageEventArgs