InfoMessage event

Occurs when UltraLite.NET sends a warning or an informational message on this connection.

Syntax
Visual Basic
Public Event InfoMessage As ULInfoMessageEventHandler
C#
public event ULInfoMessageEventHandler InfoMessage;
Remarks

To process UltraLite.NET warnings or informational messages, you must create a ULInfoMessageEventHandler delegate and attach it to this event.

Example

The following code defines an informational message event handler.

' Visual Basic
Private Sub MyInfoMessageHandler( _
      obj As Object, args As ULInfoMessageEventArgs _
    )
  System.Console.WriteLine( _
      "InfoMesageHandler: " + args.NativeError + ", " _
      + args.Message _
    )
End Sub

// C#
private void MyInfoMessageHandler(
      object obj, ULInfoMessageEventArgs args
    )
{
  System.Console.WriteLine(
      "InfoMesageHandler: " + args.NativeError + ", "
      + args.Message
    );
}

The following code adds the MyInfoMessageHandler to the connection named conn.

' Visual Basic
AddHandler conn.InfoMessage, AddressOf MyInfoMessageHandler

// C#
conn.InfoMessage +=
  new ULInfoMessageEventHandler(MyInfoMessageHandler);
Event data
  • NativeError   The SQL code corresponding to the informational message or warning returned by the database.

  • Message   The informational or warning message string returned by the database.

  • Source   The name of the ADO.NET data provider returning the message.

See also