InfoMessage Event

Topics: Data Access Application Block
Feb 9, 2007 at 11:51 AM
The SQL Connection object in .NET contains the InfoMessage event which is helpful for reporting low severity errors back to the client. Is there any way to make use of this event using the Data Access Application Block?
Feb 9, 2007 at 1:02 PM
I don't see support for the InfoMessage Event. The DAAB tries to stay database independent so you can swap in and out database providers with little to no effort. The InfoMessage Event is particular to SqlConnection and not available on the DbConnection Class.

However, you can modify the source code. One option is to add the event as virtual in the Database Class and have it throw a NotImplementedException. In the SqlDatabase Class override the event and attach it to the connection class where appropriate.

Regards,

Dave

____________________

David Hayden
Microsoft MVP C#