Data Haunting

Easy Solutions Destination


Procedure or function expects parameter which was not supplied

We have seen this error number of  times that is “Procedure or function expects parameter which was not supplied”  in c# and sql server . Every time reason for this error is different . Today here I will explain different reasons for this most common error.

  • Having not  passing parameter to Sql server stored procedure from

This is most common mistake done by develop . You should check first this in your sql server input parameter and in  your Output parameter.

suppose your input parameter in sql server stored procedure or function is as below

so now check that you have supplied all this output parameter from you language C# or VB correctly or not . It must be like as below if your SqlCommand object is cmd .

  • Set proper CommandType  to StoredProcedure

This another common mistake done by developer . Some times they not providing proper CommandTypeSo if you are calling StoredProcedure than you must select CommandType to StoredProcedure . You must have to specify CommandType.


  • DBNull Value to output parameter

Sometimes this one also make headache for programmer . In case if you are passing output parameter from to Sql Server Stored Procedure or  Sql Server function it is necessary to check whether value is null or not . If value is null than you should pass value like

As describe all solutions above I hope it will definitely solve your problem.

3 Responses to Procedure or function expects parameter which was not supplied

  1. J German says:

    Thanks! All those solutions did solve my problem! DBNull.Value was the trick.

  2. anitha says:

    wow……….. super.. thanks a lot

Leave a Reply