In ADO.Net on the connection object there's an event called
InfoMessage
You don't get each message as it's written, I think it works using streams which pushes out the text periodically where there's a lot of message or at the end where there's few.
I haven't tested that this works when your original ADO command is causing the trigger execution, but nonetheless, it would be good if you could reply and let us all know.
connection.InfoMessage += delegate(object sender, SqlInfoMessageEventArgs e)
{
txtMessages.Text +="\n" + e.Message;
};
Any messages written to the text output when running SQL for ADO.Net this includes all messages written using the
PRINT
command in SQL.
The following article covers this in more detail:
http://www.dotnetcurry.com/ShowArticle.aspx?ID=344[
^]