Monday, February 20, 2012

Procedure x expects parameter @y which was not supplied.

I'm trying to update a member's record via stored procedure. The procedure is thus:

*********************************
CREATE PROCEDURE upd_MemberProfile(
@.MemberID VarChar(10),
@.FirstName VarChar(20),
@.LastName VarChar(20),
@.Address VarChar(50),
@.City VarChar(40),
@.StateID Char(2),
@.ZipCode Char(5),
@.Email VarChar(30),
@.PayPalSubscrID VarChar(22)
) AS

UPDATE Members
SET FirstName = @.FirstName, LastName = @.LastName, Address = @.Address, City = @.City, StateID = @.StateID, ZipCode = @.ZipCode, Email = @.Email, PayPalSubscrID = @.PayPalSubscrID
WHERE MemberID = @.MemberID
GO
*****************************

The call from the Webpage is like so:

*****************************
...
Dim Subscr_id As String = "123ABC-HDTV"

Try
cmd.CommandText = dbo() & "upd_MemberProfile"
cmd.CommandType = CommandType.StoredProcedure

With cmd.Parameters
.Add("@.MemberID", MemberID)
.Add("@.FirstName", FirstName)
.Add("@.LastName", LastName)
.Add("@.Address", Address)
.Add("@.City", City)
.Add("@.StateID", StateID)
.Add("@.ZipCode", ZipCode)
.Add("@.Email", Payer_email)
.Add("@.PayPalSubscrID", Subscr_id)
End With

If cnn.State.Open Then
cnn.Close()
End If

cnn.Open()
cmd.ExecuteNonQuery()
cnn.Close()

Catch ex As Exception

'Notify Admin of the Problem
MailUsTheOrder("ERROR on upd_MemberProfile: " & ex.Message)

'Close the SQL Connection
If cnn.State.Open Then
cnn.Close()
End If
End Try
******************************

This was working two weeks ago. I have changed NOTHING and now I get the error:

Procedure 'upd_MemberProfile' expects parameter '@.PayPalSubscrID', which was not supplied.

Any Ideas?yup. you might not be setting that parameter in another method or something. Do you have any overloads or anything? step through the application, and see if the right method is being called.|||Hi,
is your Subscr_id 's value nothing?

No comments:

Post a Comment