Error - procedure expects parameter, which was not supplied

G

Guest

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
 
C

Chris Dunaway

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top