SP Expects paramater not supplied error

  • Thread starter Thread starter Cirene
  • Start date Start date
C

Cirene

I have a stored procedure named insertcompany.

I keep getting the error:
Sys.webforms.pagerequestmanagerservererrorexception: Procedure or function
'InsertCompany' expects parameter '@ApptPhone1Required', which was not
supplied.

But, I DID supply it along with all others.... (here's a snippet)

MyCommand.Parameters.AddWithValue("@InstructionsOperator",
CType(multiPage.FindControl("txtInstructionsOperator"), TextBox).Text)
MyCommand.Parameters.AddWithValue("@InstructionsCustomer",
CType(multiPage.FindControl("txtInstructionsCustomer"), TextBox).Text)
MyCommand.Parameters.AddWithValue("@ApptPhone1Required",
CType(multiPage.FindControl("checkbox1"), CheckBox).Checked)
MyCommand.Parameters.AddWithValue("@ApptPhone1Show",
CType(multiPage.FindControl("checkbox2"), CheckBox).Checked)

Any ideas what is wrong with this? The other params seem to work fine.

Thanks
 
The only thing I can think of off hand is the value is the wrong format.

One way to check, if this is a developer SQL install, is to stoke up
Profiler and see what command is being sent to SQL Server. That will show
you if the parameter is missing or just incorrect.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
 
Never heard of that tool, but sounds good. Is there a way to see EXACTLY
which parameters are being passed into a stored proc using this tool?
 
check to see if the value you are passing in is null (or nothing) this will
give this error sometimes. I know that you should get a "not set to an
instance ... " because you are using find control", but other than you just
named the parameters wrong along the way this is all i can think of
 
thanks - alot of the data webpages i do i have no code, just use the data
binding controls, etc...

so sometimes when i call a stored proc its hard to debug

this profiler things has caught my attention - wonder if it would tell me
all the PARAMS sent to the stored proc and EXACTLY what their values are

anyone have any insight????

thanks!!
 
Yes, SQL Server Profiler can show the text of every command passed to the
server. It's an essential debugging and performance management tool. You can
copy any SQL statements that were passed into the server, and then run the
same command in SQL Manager so you can troubleshoot issues. However, there
is a bit of a learning curve getting it to display the info you want, and if
it's a busy server, getting it NOT to display all the other server
communication. Look in SQL's Books Online for usage info.
 
Back
Top