skip to main content
Developing ADO.NET Applications : Event Handling
 

Event Handling

The event handler receives an argument of type OpenAccessInfoMessageEventArgs, which contains data relevant to an event. See OpenAccessInfoMessageEventArgs Object for more information.
This event is defined as:
public event OpenAccessInfoMessageEventHandler InfoMessage;
Clients that want to process warnings and informational messages sent by the database server should create an OpenAccessInfoMessageEventHandler delegate to listen to this event.
The following code fragment defines a delegate that represents the method that handles the InfoMessage event of an OpenAccessConnection object:
[Serializable]
public delegate void OpenAccessInfoMessageEventHandler(
object sender
OpenAccessInfoMessageEventArgs e
);
where sender is the object that generated the event and e is an OpenAccessInfoMessageEventArgs object that describes the warning.