HomeHome Product Discus... Product Discus...SmithCartSmithCartOnCheckout Stored Procedure returns errorOnCheckout Stored Procedure returns error
Previous
 
Next
New Post
2/23/2012 11:15 AM
 

Hi,

I have created a stored procedure which takes no parameters and just updates the coupon table. When the stored procedure is fired I get:

A critical error has occurred.
Parameter count does not match Parameter Value count.

 I don't understand why I'm getting this error. I don't have any parameters defined and I'm not trying to pass any parameters.

Please help.

Thanks,

David

 

 
New Post
2/23/2012 12:22 PM
 

Hi David,

Please check the following 2 items to resolve the error you are getting calling your custom stored procedure on checkout:

1.  Store Procedure Naming Convention - It is important that your stored procedure is named correctly as follows:
 
DatabaseOwner + ObjectQualifier + ModuleQualifier in front of your stored procedure.
  • DatabaseOwner is usually “dbo”
  • ObjectQualifier – Is assigned when you installed DNN.  The objectqualifier in your database could be "dnn" or you may not be using one.  If you are not sure you can check by logging into your database using SSMS.
  • ModuleQualifier is “Smith”
 
For example, a stored procedure titled “TransferOrder” should be named as follows if your objectqualifier is "dnn" :
 
“dbo.dnn_Smith_ TransferOrder”
 
2.  Parameters Passed To Stored Procedure
 
The following two parameters are passed to your custom stored procedure on checkout complete:
 
OrderID (String) – SmithCart order id generated for the new order.
 
SCData (String) – Custom parameter that passes the value of a session variable (SCData) to your stored procedure when checkout is complete.  The "SCData" parameter allows the cart to integrate with another Asp.Net application or other modules in your portal.  Note:  SmithCart does not populate the SCData session object, it is only populated by another application or module on your site.  If you don’t have a requirement for passing additional data using SCData it will be passed as an empty string.  
 
Please Note:  It is required that the “OrderID” and “SCData” parameters are defined as varchar or nvarchar parameters at the top of your stored procedure. 
 
Hope this helps!
 
 

Scott Kelly
Project Manager
DotNetNuke Consulting, DotNetNuke Store and DNN Ecommerce
 
New Post
2/23/2012 2:24 PM
 

Hi Scott,

Thanks so much for the detailed response.

I followed it but I still get the same error.

Here is my stored procedure. Do you see anything wrong?

David

----------------------------------------------------------------------------------------------------------------------------------------------

USE [techsolidservic]
GO
/****** Object:  StoredProcedure [dbo].[Smith_UpdateCouponDiscountPercent]    Script Date: 02/23/2012 14:35:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:  David Wathen
-- Create date:
-- Description: 
-- =============================================
ALTER PROCEDURE [dbo].[Smith_UpdateCouponDiscountPercent]
 -- Add the parameters for the stored procedure here
 @OrderID varchar(50),
 @SCData varchar(50)
AS
BEGIN
 -- SET NOCOUNT ON added to prevent extra result sets from
 -- interfering with SELECT statements.
 SET NOCOUNT ON;

    -- Insert statements for procedure here
UPDATE [techsolidservic].[dbo].[Smith_Coupons]
SET DiscountPercent = '0'
WHERE CouponID = (SELECT [CouponId] FROM [techsolidservic].[dbo].[Smith_StoreOrders] where OrderID = (select MAX(OrderID) from [techsolidservic].[dbo].[Smith_StoreOrders]))

END

 
New Post
2/23/2012 7:22 PM
 
The error message you are getting "Parameter count does not match Parameter Value count." means that the parameters the cart is calling your stored proc with do not match the parameters defined at the top of your stored proc. I checked on the code today and the cart is definitely sending the 2 parameters "OrderID" and "SCData" If your stored proc didnt have those parameters before and you added them today its possible that your old stored proc is cached you can try restarting the sql server service or rebooting the server should clear the cache and fix it.


Scott Kelly
Project Manager
DotNetNuke Consulting, DotNetNuke Store and DNN Ecommerce
 
Previous
 
Next
HomeHome Product Discus... Product Discus...SmithCartSmithCartOnCheckout Stored Procedure returns errorOnCheckout Stored Procedure returns error