Home

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.