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 7538873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:13:54+00:00 2026-05-30T07:13:54+00:00

I saw that some others faced this similar problem. I have read and checked

  • 0

I saw that some others faced this similar problem. I have read and checked the question titled Procedure expects parameter which was not supplied. I thought it would solve my problem but I was wrong 🙁 I did check the steps that were advised there with no luck. Here is my code:

oOleDbCommand.CommandText = "usp_PettyCash_AddBillInfo";
oOleDbCommand.Parameters.Add("@BillID", OleDbType.BigInt).Value = nBillID;
oOleDbCommand.Parameters.Add("@SerialNo", OleDbType.VarChar).Value = sSerialNo;
oOleDbCommand.Parameters.Add("@UniqueID", OleDbType.VarChar).Value = oInputBill[0].UniqueID.ToString();
oOleDbCommand.Parameters.Add("@BilledWeekDate", OleDbType.Date).Value = oInputBill[0].BilledWeekDate;
oOleDbCommand.Parameters.Add("@BilledWeekNo", OleDbType.VarChar).Value = oInputBill[0].BilledWeekNo.ToString();
oOleDbCommand.Parameters.Add("@SettledWeekDate", OleDbType.Date).Value = oInputBill[0].SettledWeekDate;
oOleDbCommand.Parameters.Add("@SettledWeekNo", OleDbType.VarChar).Value = oInputBill[0].SettledWeekNo;
oOleDbCommand.Parameters.Add("@BillStatus", OleDbType.VarChar).Value = oInputBill[0].BillStatus.ToString();
oOleDbCommand.Parameters.Add("@UpdatedBy", OleDbType.VarChar).Value = oInputBill[0].UpdatedBy;
oOleDbCommand.Parameters.Add("@UpdateDate", OleDbType.Date).Value = oInputBill[0].UpdateDate;

Stored Procedure is:

CREATE PROCEDURE usp_PettyCash_AddBillInfo 
(
    @BillID bigint,
    @SerialNo varchar(50),
    @UniqueID varchar(50),
    @BilledWeekDate datetime,
    @BilledWeekNo varchar(50),
    @SettledWeekDate datetime,
    @SettledWeekNo varchar(50),
    @BillStatus varchar(50),
    @UpdatedBy varchar(50),
    @UpdateDate datetime 
)
AS

BEGIN  
    INSERT INTO t_BillInfo (BillID, SerialNo, UniqueID, BilledWeekDate, BilledWeekNo, SettledWeekDate, SettledWeekNo, BillStatus, UpdatedBy, UpdateDate) 
    VALUES (@BillID, @SerialNo, @UniqueID, @BilledWeekDate, @BilledWeekNo, @SettledWeekDate, @SettledWeekNo, @BillStatus, @UpdatedBy, @UpdateDate) 
END 

GO

While debugging, i found the value of nBillID = 1.0 and sSerialNo='B201200001'. But when trying to execute the ExecuteNonQuery command, it gives the exception:

“Procedure ‘usp_PettyCash_AddBillInfo’ expects parameter ‘@BillID’,
which was not supplied.”

I can’t find any workarounds. Please help. Sorry for re-asking the question.

As a workaround, I used this:

oOleDbCommand.CommandText = "INSERT INTO t_BillInfo (BillID, SerialNo, UniqueID, BilledWeekDate, BilledWeekNo, SettledWeekDate, SettledWeekNo, BillStatus, UpdatedBy, UpdateDate)"+
" VALUES (" + nBillID + ", '" + sSerialNo + "', '" + oInputBill[0].UniqueID.ToString() + "','" + oInputBill[0].BilledWeekDate.ToShortDateString() + "', '" + oInputBill[0].BilledWeekNo + "', '" + oInputBill[0].SettledWeekDate.ToShortDateString() + "', '" + oInputBill[0].SettledWeekNo + "', '" + oInputBill[0].BillStatus.ToString() + "', '" + oInputBill[0].UpdatedBy + "', '" + oInputBill[0].UpdateDate.ToShortDateString() + "')";

Although I did not like this type of coding, but this works.

  • 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-30T07:13:55+00:00Added an answer on May 30, 2026 at 7:13 am

    Try adding:

    oOleDbCommand.CommandType = CommandType.StoredProcedure;
    

    I believe without this, your parameter values are supposed to be added inline (like an inline SQL statement). E.g:

    oOleDbCommand.CommandText = "usp_PettyCash_AddBillInfo @BillID, @SerialNo...";
    

    So your adding your parameters to the command, but they are not in the CommandText, so they’re not being applied anywhere.

    To call a stored procedure, set the CommandType of the Command object
    to StoredProcedure. Once the CommandType is set to StoredProcedure,
    you can use the Parameters collection to define parameters, as in the
    following example.

    http://msdn.microsoft.com/en-us/library/yy6y35y8(v=vs.71).aspx

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

Sidebar

Related Questions

Does jQuery validation plugin have some dependencies? For example, I saw blogposts that said
I saw this in some code: $(<p/>).append(<div>something</div>).appendTo(body); and noticed that it automatically closed the
I'm searching for this for quite some time now. I saw few similar questions
I saw some scala code that assign _ to a field of class, what
This question is a little different from the others I've found here. My In
Before voting to close, please read, I know that there are similar questions (:
What a great site this is, I have lurked on here reading others questions
I saw that to show a JOptionPane message dialog I need the shutdownHooks permition.
I saw that one of our tools uses a ConsoleAppender to System.err next to
I just recently saw that xcopy is deprecated and that Robocopy is recommended. I

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.