Stored procedure or function expects parameter which was not supplied

后端 未结 9 1296
梦谈多话
梦谈多话 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:24

    For others : I just faced the same error because one of my parameters was null. We need to check for it such as :

    command.Parameters.AddWithValue("@phone", (object)phone?? DBNull.Value);
    

提交回复
热议问题