Capture Stored Procedure print output in .NET

You can do this by adding an event handler to the InfoMessage event on the connection.

 myConnection.InfoMessage += new SqlInfoMessageEventHandler(myConnection_InfoMessage);

    void myConnection_InfoMessage(object sender, SqlInfoMessageEventArgs e)
    {
       Console.WriteLine(e.Message);
    }

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)