SP Expects paramater not supplied error

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
 
C

Cowboy \(Gregory A. Beamer\)

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.
 
C

Cirene

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?
 
Y

Yankee Imperialist Dog

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
 
C

Cirene

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!!
 
P

Paul Shapiro

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.
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top