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

  • SEARCH
  • Home
  • 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 7835859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:50:30+00:00 2026-06-02T13:50:30+00:00

Towards the end of my code I am calling a stored procedure which updates

  • 0

Towards the end of my code I am calling a stored procedure which updates a table based on the parameters passed by my page. I get the following error:

Procedure or function ‘Res_invpush_UpdateInv’ expects parameter ‘@InventoryPushSubscriptionId’, which was not supplied.

Even thought my parameter value is being successfully passed – I know this because I have tested using breakpoints and when I mouse over on the parameter mentioned it gives the value of 1 so I don’t know why the message is still coming.

Can somebody please show me where exactly am I going wrong or how to fix it?

SendInvUpdate.InvServices.UpdateRatePackagesRequest ur = new SendInvUpdate.InvServices.UpdateRatePackagesRequest();
    SendInvUpdate.InvServices.UpdateRatePackagesOperationResponse or = new SendInvUpdate.InvServices.UpdateRatePackagesOperationResponse();


    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            string connStr = ConfigurationManager.ConnectionStrings["bb"].ConnectionString;
            SqlConnection Con = new SqlConnection(connStr);
            Con.Open();
            SqlCommand cmd = new SqlCommand("invpush_PollForAvailableChanges", Con);
            cmd.CommandType = CommandType.StoredProcedure;
            SqlParameter NewSysChangeVersionParam = new SqlParameter("@NewSysChangeVersion", SqlDbType.Int);
            NewSysChangeVersionParam.Value = (object)NewSysChangeVersionParam ?? DBNull.Value;
            NewSysChangeVersionParam.Direction = ParameterDirection.InputOutput;
            NewSysChangeVersionParam.SqlDbType = SqlDbType.BigInt;
            SqlDataReader sdr = cmd.ExecuteReader();

            InventoryPushSubscriptionRecord rec = new InventoryPushSubscriptionRecord();

            while (sdr.Read())
            {

                rec.InventoryPushSubId = sdr.GetInt32(0);
                rec.CMName = sdr.GetString(1);
                rec.NotifUrl = sdr.GetString(2);
                rec.Options = sdr.GetString(3);
                rec.LastSysChangeVersion = sdr.IsDBNull(4)?(long?)null:sdr.GetInt32(4);

            }

            if(!sdr.NextResult()) throw new System.Exception("Expected Result set 1 for InventoryChangeRecord");
            InventoryChangeRecord inrec = new InventoryChangeRecord();
            while (sdr.Read())
            {
                inrec.InventoryPushSubId= sdr.GetInt32(0);
                inrec.SysChangeVersion=sdr.IsDBNull(1)?(long?)null:sdr.GetInt32(1);
                inrec.InvDate=sdr.GetDateTime(2);
                inrec.ResId=sdr.GetInt32(3);
                inrec.RoomType=sdr.GetString(4);
                inrec.InvCount=sdr.GetInt32(5);
                inrec.ResName=sdr.GetString(6);

            }

            sdr.Close();
            sdr.Dispose();

            if (NewSysChangeVersionParam != null)
            {
                SendInvUpdate.InvServices.InventoryServiceClient isc = new SendInvUpdate.InvServices.InventoryServiceClient();
                        or = isc.UpdateRatePackages(request);


                        res = or.Results.ToString();
                        int Subid;
                        SubId=inrec.InventoryPushSubscriptionId;
                        SqlCommand ucmd = new SqlCommand("Res_invpush_UpdateInv", Con);
                        ucmd.CommandType = CommandType.StoredProcedure;
                        SqlParameter LastChange = new SqlParameter("@NewLastSysChangeVersion", SqlDbType.Int);
                        LastChange.Value = NewSysChangeVersionParam;
                        SqlParameter SubscriptionId = new SqlParameter("InventoryPushSubscriptionId", SqlDbType.Int);
                        SubscriptionId.Value = SubId;
                        ucmd.ExecuteNonQuery();


                    }

                }
            }                             

        }

        catch (Exception ex)
        {
            throw (ex);
        }
    }

}
  • 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-06-02T13:50:32+00:00Added an answer on June 2, 2026 at 1:50 pm

    First, as Mike mentions, you should be consistent with the parameter naming.

    e.g.

    SqlParameter SubscriptionId = new SqlParameter("InventoryPushSubscriptionId", SqlDbType.Int);
    

    should be

    SqlParameter SubscriptionId = new SqlParameter("@InventoryPushSubscriptionId", SqlDbType.Int);
    

    And then as @NSGaga points out, you are not really passing the parameters to the command, you just create the objects and aren’t using them anywhere.

    Like this:

    SqlParameter LastChange = new SqlParameter("@NewLastSysChangeVersion", SqlDbType.Int);
    LastChange.Value = NewSysChangeVersionParam;
    ucmd.Parameters.Add(LastChange);
    SubscriptionId = new SqlParameter("@InventoryPushSubscriptionId", SqlDbType.Int);
    SubscriptionId.Value = SubId;
    ucmd.Parameters.Add(SubscriptionId);
    

    Hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my code: In onCreate: new LoadMusicInBackground().execute(); Then towards the end of my
I'm have a StringBuilder that is writing content to a file. Towards the end
Can anyone point me towards some good documentation / code examples on how best
I have a straightforward NSDocument -based Mac OS X app in which I am
Consider the following code: from numpy import log2 import matplotlib.pyplot as plt xdata =
The following code in the .htaccess file is supposed to, among others I guess,
Coming up towards the end of developing an iPhone application and I'm wondering just
Ok, the code I have is the following: for shidx in xrange(0, book.nsheets): print
I have the following code that will download a file asynchronously to my hard-drive,
I'm debugging a matlab script that takes ~10 minutes to run. Towards the end

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.