Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6655085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:28:14+00:00 2026-05-26T01:28:14+00:00

i have a stored procedure that i tested directly and it works, but when

  • 0

i have a stored procedure that i tested directly and it works, but when i call it from code i get the error:

“Procedure or function editItem has too many arguments specified”

Can someone please tell me why this error happens? Is it because my sqlDataSource is passing parameters from BIND that the stored procedure does,t need? I thought extra parameters where just ignored by the stored procedures.

Thanks

Edit: Here is some more info about the problem. Its got me baffled. Basically, i got a bunch of items added to the templates like so:

                           <EditItemTemplate>
                            <asp:TextBox runat="server" ID="tbEditItemDescription" Text='<%# Bind("itemDescription") %>'></asp:TextBox>
                        </EditItemTemplate>

Now as far as i know, Bind supplies the parameter automatically. I also have 5 parameters i added manually, like so:

                <UpdateParameters>
                    <asp:ControlParameter DbType="Int16" Name="itemTypeId" ControlID="dvIndividualItem$ddlItemTypes"
                        PropertyName="SelectedValue" />
                    <asp:ControlParameter DbType="Int16" Name="itemSubTypeId" ControlID="dvIndividualItem$ddlItemSubTypes"
                        PropertyName="SelectedValue" />
                    <asp:ControlParameter DbType="Int64" Name="itemSubSubTypeId" ControlID="dvIndividualItem$ddlItemSubSubTypes"
                        PropertyName="SelectedValue" />
                    <asp:ControlParameter DbType="Int16" Name="numberOfTurns" ControlID="dvIndividualItem$tbEditEffectTurns"
                        PropertyName="Text" />
                    <asp:ControlParameter DefaultValue="0" DbType="Int64" Name="itemId" ControlID="gvItems"
                        PropertyName="SelectedDataKey.Value" />

Now when i debugged the sql data source, i found that it actually only has 5 parameters (the ones i added manually). How is it possible, that it is giving me an error of having too many parameters, when it infact has LESS parameters than it needs? Or am i just looking in the wrong place? I looked in UpdateParameters ==> base ==> count, which contains 5.

Thanks for the help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:28:14+00:00Added an answer on May 26, 2026 at 1:28 am

    Quite simply, you are sending in more arguments than the procedure is expecting.

    Procedure with 3 parameters:

    ALTER PROCEDURE [dbo].[GetData](
        @Arg1 VARCHAR(50),
        @Arg2 VARCHAR(50),
        @Arg3 VARCHAR(50)
    )AS
    

    Code with 4 parameters:

    cmd.Parameters.Add("@Arg1", SqlDbType.VarChar).Value = "Arg1"; 
    cmd.Parameters.Add("@Arg2", SqlDbType.VarChar).Value = "Arg2"; 
    cmd.Parameters.Add("@Arg3", SqlDbType.VarChar).Value = "Arg3"; 
    cmd.Parameters.Add("@Arg4", SqlDbType.VarChar).Value = "Arg4"; 
    
    //execute = BANG! Procedure is not expecting @Arg4
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a stored procedure that I want to call from within another, and
I have a stored procedure that logs some data, how can I call this
I have stored procedure that insanely times out every single time it's called from
I am trying to call a SQL Server stored procedure from my Python code,
I have a Stored Procedure that takes parameters, but does not return anything. How
I have a stored Procedure that works fine joining 2 tables together. I needed
I have stored procedure that I created in MySQL and want PHP to call
I have a stored procedure that has the parameter: @desk VARCHAR(50) I want to
I have this stored procedure that I want to use for my SAP crystal
I have a stored procedure that returns data in the format of: Date |

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.