is it possible to access the InfoMessage event handler in a Linq2SQL data context? All of our code uses these messages to display useful information to the end user and since moving to Linq2SQL I cannot figure out how to show these messages. I have checked the connection object of the data context as well as the classes properties with no luck so I’m wondering if it is possible.
Thanks in advance.
You need to simply cast the context’s connection to a
SqlConnectionand then hook up your info message handling routine:and then of course implement that
SqlInfoMessageEventHandlerin your code.