OleDbConnection.InfoMessage 事件


在提供程序发送警告或信息性消息时发生。Occurs when the provider sends a warning or an informational message.

 event System::Data::OleDb::OleDbInfoMessageEventHandler ^ InfoMessage;
public event System.Data.OleDb.OleDbInfoMessageEventHandler InfoMessage;
member this.InfoMessage : System.Data.OleDb.OleDbInfoMessageEventHandler 
Public Custom Event InfoMessage As OleDbInfoMessageEventHandler 


要处理警告或服务器发送的信息性消息的客户端应创建 OleDbInfoMessageEventHandler 委托来侦听此事件。Clients that want to process warnings or informational messages sent by the server should create an OleDbInfoMessageEventHandler delegate to listen to this event.

当从数据源返回严重性较低的消息时发生 InfoMessage 事件。The InfoMessage event occurs when a message with low severity is returned from the data source. 低严重性消息是指不会引发异常的消息。Low severity messages are those that do not cause an exception. 对于 Microsoft SQL Server,这包括严重性为10或更低的错误消息For Microsoft SQL Server, this includes error messages that have a severity of 10 or less

有关详细信息和示例,请参阅连接事件For more information and an example, see Connection Events.