Sending an Email to the user causes the error - [SqlException (0x80131904)
A severe error occurred on the current command. The results, if any, should be discarded.
[SqlException (0x80131904): A severe error occurred on the current command. The results, if any, should be discarded.]
This error is being generated when my ASP.NET 2.0 program calls a stored procedure, which sends the user an email when a new record is created. However the email is sent with no problem.
Have searched through lots of sites, but have found no solution.
The SQL Server stored procedure is as follows:
CREATE PROCEDURE dbo.spCreateLessonSendEmail
DECLARE @MessagePart varchar(45)
set @MessagePart = 'You have just created a new Record ID#=' + cast(@LessonID as varchar)
@Recipients = @Receiver,
@Message = @MessagePart,
@Subject = 'New Record Created'
In the ASP.NET page itself the procedure is being called through the following code:
Dim myConnection As New System.Data.SqlClient.SqlConnection(strConn)
Dim myCommand As New System.Data.SqlClient.SqlCommand("execute dbo.StoredProcedure 'recipients.address'," + Session("Session_LessonID").ToString, myConnection)
myCommand.CommandType = Data.CommandType.Text
Dim reader As System.Data.SqlClient.SqlDataReader = myCommand.ExecuteReader()