SqlDataSource UpdateParameters supplies wrong number of params to storedproc

  • Thread starter Thread starter dotnw
  • Start date Start date
D

dotnw

If I try and update an SqlDataSource inside a DetailsView control,
using a stored procedure, I get this error -

Procedure or function DataViews_UpdateDetails has too many arguments
specified

However, if I just simply remove the stored procedure call, and use
"inline" sql instead, and leave the UpdateParameters totally unchanged,
and the sql totally unchanged as well (just copy it from the stored
proc to the html section), it works fine, and there are no errors.

Any ideas very welcome, thanks, regards, dnw.
 
Sounds to me that stored procedure requires less parameters?
What is the definition of SP and what is your code?
 
The sp is

ALTER PROCEDURE [dbo].[DataViews_UpdateDetails]
@vcDetails varchar(50),
@cExtraDetails1 char(10),
@cExtraDetails2 char(10),
@cExtraDetails3 char(10),
@original_iId int,
@original_vcDetails varchar(50),
@original_cExtraDetails1 char(10),
@original_cExtraDetails2 char(10),
@original_cExtraDetails3 char(10)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

UPDATE DataViews_Details
SET vcDetails = @vcDetails, cExtraDetails1 = @cExtraDetails1,
cExtraDetails2 = @cExtraDetails2, cExtraDetails3 = @cExtraDetails3
WHERE iId = @original_iId AND
vcDetails = @original_vcDetails AND
cExtraDetails1 = @original_cExtraDetails1 AND
cExtraDetails2 = @original_cExtraDetails2 AND
cExtraDetails3 = @original_cExtraDetails3
END

And the UpdateParameters is

<UpdateParameters>
<asp:Parameter Name="vcDetails" Type="String" />
<asp:Parameter Name="cExtraDetails1" Type="String" />
<asp:Parameter Name="cExtraDetails2" Type="String" />
<asp:Parameter Name="cExtraDetails3" Type="String" />
<asp:Parameter Name="original_iId" Type="Int32" />
<asp:Parameter Name="original_vcDetails" Type="String"
/>
<asp:Parameter Name="original_cExtraDetails1"
Type="String" />
<asp:Parameter Name="original_cExtraDetails2"
Type="String" />
<asp:Parameter Name="original_cExtraDetails3"
Type="String" />
</UpdateParameters>

There is actually no code at all.

Thanks, regards, dnw.
 
Back
Top