473,395 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Error - procedure expects parameter, which was not supplied

Hi,

I created a stored procedure in the sql server. I try to insert a record
from the aspx page. But I keep getting this error,
"procedure expects parameter <@firstname>, which was not supplied". This is
what I am doing.

cmd.CommandText = "proc_insertuser";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@firstname", SqlDbType.VarChar, 50);
cmd.Parameters["@firstname"].Value = txtFirstName.Text
.....other parameters

I checked the parameter names, it matches correctly. The parameter does get
added to the collection. I checked it using
cmd.Parameters.Contains("@firstname") and the value is also correct. Using
query analyzer I executed the procedure, I am able to insert a record.

Can anyone tell me what could be the problem.
TAI
Senthil
Nov 22 '05 #1
1 5687
On Tue, 24 Aug 2004 16:55:03 -0700, Senthil wrote:
I created a stored procedure in the sql server. I try to insert a record
from the aspx page. But I keep getting this error,
"procedure expects parameter <@firstname>, which was not supplied". This is
what I am doing.


Does your stored procedure have any other parameters besides @firstname? A
result parameter perhaps? Can you show us the stored procedure (or at
least the first few lines of it)?

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: JC | last post by:
Can someone post a working stored procedure with output variable that works on northwind db or explain to me what I am missing. I've tried ever tying but it always returns @outvariable parameter...
1
by: Senthil | last post by:
Hi, I created a stored procedure in the sql server. I try to insert a record from the aspx page. But I keep getting this error, "procedure expects parameter <@firstname>, which was not...
1
by: Stephen | last post by:
I'm having terrible trouble working out where I have gone wrong in my code below. In the data layer I have two methods and i'm basically returning a command and using it and then returning a...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
1
by: Stephen | last post by:
I'm having terrible trouble working out where I have gone wrong in my code below. In the data layer I have two methods and i'm basically returning a command and using it and then returning a...
7
by: Leon Shaw | last post by:
Need help understanding? Server Error in '/solo' Application. ---------------------------------------------------------------------------- ---- Object must implement IConvertible....
5
by: Andy G | last post by:
I am getting an error when I try to call my stored procedure. Exception adding account. Procedure 'stpCFSPH_CM_RGST_USER' expects parameter '@USER_DESCR', which was not supplied. I have a radio...
0
by: itamar82 | last post by:
I have a SP running on mssql server 2005. When I try to execute the SP through asp I receive back an error that the parameter @City is not supplied, although I clearly do supply it. Here is my...
3
by: PrakashN | last post by:
Hi, While executing the com.com.ExecuteNonQuery() error it shows the error as ERROR Procedure or Function 'AddCustomer' expects parameter '@ID', which was not supplied. But i am passing the...
7
by: Cirene | last post by:
I have a stored procedure named insertcompany. I keep getting the error: Sys.webforms.pagerequestmanagerservererrorexception: Procedure or function 'InsertCompany' expects parameter...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.