Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 » UltraLite - .NET Programming » UltraLite .NET 2.0 API reference » ULConnection class


InfoMessage event

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

Visual Basic
Public Event InfoMessage As ULInfoMessageEventHandler
public event ULInfoMessageEventHandler InfoMessage;

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


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
      "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