Connection InfoMessage Event Handler

How can I add a InfoMessage Event Handler to the current connection I'm using?

Something like this:

myConnection.InfoMessage += new SqlInfoMessageEventHandler(myConnection_InfoMessage);

void myConnection_InfoMessage(object sender, SqlInfoMessageEventArgs e)
{
myStringBuilderDefinedAsClassVariable.AppendLine(e.Message);
}

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!