|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Procedure or function has too many arguments specified.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. 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 ... 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 ... |
|||||||||||||||||||||||