Home All Groups Group Topic Archive Search About

Procedure or function has too many arguments specified.

Author
22 Dec 2005 4:35 PM
tomm
I've seen others have had trouble with this. Using vs2005 connecting to
sql2000, procedure works from command object with parameters but
doesn't from a datasource defined on the page. I've tried any number of
variations to get it to work, uses a session parameter and three
control parameters from a bound gridview. Parameters have correct
values before execution, they are in the same order on the page:
<DeleteParameters>
<asp:SessionParameter SessionField="TempJobID" Name="JobID"
Type="Int32" />
<asp:Parameter Name="LoanBudgetID" Type="Int32" />
<asp:Parameter Name="StageItemID" Type="Int32" />
<asp:Parameter Name="StageID" Type="Int32" />
</DeleteParameters>

Have tried controlparameter with selectedvalue, nothing works. SP
below:

    @JobID int,
    @LoanBudgetID int,
    @StageItemID int,
    @StageID int
AS
    BEGIN
        DELETE FROM tblStageItems
            WHERE StageItemID = @StageItemID

        DELETE FROM tblLoanBudgetLineItems
            WHERE JobID = @JobID AND LoanBudgetID = @LoanBudgetID
                AND LineItemID = @StageItemID AND StageID = @StageID
    END

I was able to get the delete to work using the delete rowcommand event
and a command object and using a fake delete command for the gridview
but it's a hack and I refuse to use it in production. Any pointers
welcome.

Author
22 Dec 2005 4:46 PM
tomm
Well, just after I posted this I got things working properly by using
BOTH the gridview commandrow delete event AND the datasource delete
command definitions and parameters. Before I was just trying to use the
delete command from the datasource and always got the error, so I added
back in the delete event handler in my code behind and it works as
expected. Go figure ...
Author
22 Dec 2005 4:46 PM
tomm
Well, just after I posted this I got things working properly by using
BOTH the gridview commandrow delete event AND the datasource delete
command definitions and parameters. Before I was just trying to use the
delete command from the datasource and always got the error, so I added
back in the delete event handler in my code behind and it works as
expected. Go figure ...

AddThis Social Bookmark Button