title: Run SQL Stored Procedure And Return Print Message vb.net
body: <p>I have a stored procedure with 2 parameters and which returns result is a <code>PRINT</code> message. I can pass the parameters in and run the stored procedure but I can't figure out how to return the result.</p>
  
  <pre><code>Imports System.Data.Sql
  Imports System.Data.SqlClient
  
  Public Class Form1
     Dim SQL As New SQLControl
     Dim cmd As New SqlCommand
  
     Private Sub RunSql_Click(sender As System.Object, e As System.EventArgs) Handles RunSql.Click
        Try
          If SQL.HasConnection = True Then
              SQL.SQLCon.Open()
              cmd.Connection = SQL.SQLCon
              cmd.CommandText = "Exec stored procedure " &amp; param1.Text &amp; "," &amp; param2.Text
              cmd.ExecuteNonQuery()
          End If
       Catch ex As Exception
          MsgBox(ex.Message)
       Finally
          SQL.SQLCon.Close()
       End Try
    End Sub
  End Class
  </code></pre>
  
  <p>Thanks in advance.</p>