Stored procedure or function expects parameter which was not supplied

后端 未结 9 1168
梦谈多话
梦谈多话 2021-01-17 08:47

I am trying to insert data into a SQL Server database by calling a stored procedure, but I am getting the error

*Procedure or function \'Insertion\'

9条回答
  •  感情败类
    2021-01-17 09:43

    Same error message still these days scoping multiple problems - my issue was passing a null value to the parameter. The answer is to null check like so:

    parameter.Value = (object)yourParamVal ?? DBNULL.Value;
    

提交回复
热议问题