Skip to content
Advertisement

Getting Error as @Parameter1 is not a parameter for procedure

I am learning mvc from this video where I am getting data from a form and saving it to database. When I ran my code first it gave an error stating

Procedure or function ‘spAddEmployee’ expects parameter ‘@Employee_Name’, which was not supplied.

I followed a solution in which I initialized my stored procedure as NULL but now I am getting another error stating “@Parameter1 is not a parameter for procedure”.

This is my stored procedure

And this is my ADO.NET code:

And this is my controller code

I am getting error at line

Please help I have tried a lot of solutions but none of them have worked.

Advertisement

Answer

This

Should be

Note: its best practice not to name your Stored Procedure with the sp prefix.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement