7 The Oracle Data Provider : Event Handling

Event Handling
The event handler receives an argument of type OracleInfoMessageEventArgs, which contains data relevant to an event. See “OracleInfoMessageEventArgs Class” for more information.
This event is defined as:
public event OracleInfoMessageEventHandler InfoMessage;
Clients that want to process warnings and informational messages sent by the database should create an OracleInfoMessageEventHandler delegate to listen to this event.
You can use these events to capture failures that can occur when creating packages, stored procedures, or stored functions, which all create commands. If Oracle encounters errors when compiling a command created by a package, stored procedure, or stored function, the object is created, even though it is not valid. An event indicating the failure will be sent.
The following code fragment defines a delegate that represents the method that handles the InfoMessage event of an OracleConnection object:
[Serializable]
public delegate void OracleInfoMessageEventHandler(
   object sender
   OracleInfoMessageEventArgs e
);
where sender is the object that generated the event and e is an OracleInfoMessageEventArgs object that describes the warning. For more information on Events and Delegates, refer to the Microsoft .NET Framework SDK documentation.