Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 by Chris Hart, John Kauffman, David Sussman, Chris Ullman; ISBN: 9780764588501
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 19th, 2009, 06:53 AM
Registered User
 
Join Date: Nov 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Angry 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.

Stack Trace:
[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
(@Receiver varchar(100),
@LessonID int)
AS
DECLARE @MessagePart varchar(45)
BEGIN

set @MessagePart = 'You have just created a new Record ID#=' + cast(@LessonID as varchar)

exec [MAILSERVERADDRESSmaster.dbo.xp_sendmail
@Recipients = @Receiver,
@Message = @MessagePart,
@Subject = 'New Record Created'


END
GO


In the ASP.NET page itself the procedure is being called through the following code:

Sub Run_spCreateLessonSendEmail()

Dim myConnection As New System.Data.SqlClient.SqlConnection(strConn)
myConnection.Open()

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()

myConnection.Close()

Server.ClearError()

End Sub





Similar Threads
Thread Thread Starter Forum Replies Last Post
[SqlException (0x80131904): Cannot open user defau wirerider ASP.NET 2.0 Basics 11 February 10th, 2007 04:55 AM
[SqlException (0x80131904): Cannot open user defau wirerider BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 February 7th, 2007 04:53 PM
Sending Email function got error Evil_Vios ASP.NET 2.0 Professional 0 September 5th, 2006 04:35 AM
Error sending email ohChuck C# 1 April 20th, 2006 01:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.