title: Getting Error as @Parameter1 is not a parameter for procedure
body: <p>I am learning mvc from <a href="https://www.youtube.com/watch?v=IAQ4u_JRk0E&amp;list=PL6n9fhu94yhVm6S8I2xd6nYz2ZORd7X2v&amp;index=13" rel="nofollow noreferrer">this</a> 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</p>
  <blockquote>
  <p>Procedure or function 'spAddEmployee' expects parameter '@Employee_Name', which was not supplied.</p>
  </blockquote>
  <p>I followed a solution in which I initialized my stored procedure as NULL but now I am getting another error stating &quot;@Parameter1 is not a parameter for procedure&quot;.</p>
  <p>This is my stored procedure</p>
  <pre><code>ALTER PROCEDURE [dbo].[spAddEmployee]
  (
      @Employee_Name varchar(max) = NULL,
      @Employee_Age int = NULL,
      @Employee_Salary int = NULL,
      @Employee_City varchar(50) = NULL
  )
  AS
  BEGIN
      INSERT INTO tblEmployee (Employee_Name, Employee_Age, Employee_Salary,  Employee_City)
      VALUES (@Employee_Name, @Employee_Age, @Employee_Salary, @Employee_City)
  END
  </code></pre>
  <p>And this is my ADO.NET code:</p>
  <pre><code>public void AddEmployee(Employee employee)
  {
      string connectionString = ConfigurationManager.ConnectionStrings[&quot;EmployeeContext&quot;].ConnectionString;
  
      using (SqlConnection con = new SqlConnection(connectionString))
      {
          SqlCommand cmd = new SqlCommand(&quot;spAddEmployee&quot;, con)
          {
              CommandType = CommandType.StoredProcedure
          };
  
          SqlParameter paramName = new SqlParameter();
          paramName.ParameterName = &quot;@Employee_Name&quot;;
          paramName.Value = employee.Employee_Name;
          cmd.Parameters.Add(paramName);
  
          SqlParameter paramAge = new SqlParameter();
          paramAge.ParameterName = &quot;@Employee_Age&quot;;
          paramAge.Value = employee.Employee_Age;
          cmd.Parameters.Add(paramAge);
  
          SqlParameter paramSalary = new SqlParameter();
          paramSalary.ParameterName = &quot;@Employee_Salary&quot;;
          paramSalary.Value = employee.Employee_Salary;
          cmd.Parameters.Add(paramSalary);
  
          SqlParameter paramCity = new SqlParameter();
          paramCity.ParameterName = &quot;@Employee_City&quot;;
          paramCity.Value = employee.Employee_City;
          cmd.Parameters.Add(paramCity);
  
          con.Open();
          cmd.ExecuteNonQuery();
      }
  }
  </code></pre>
  <p>And this is my controller code</p>
  <pre><code>[HttpPost]
  [ActionName(&quot;Create&quot;)]
  public ActionResult Create_Post(FormCollection formCollection)
  {
      Employee employee = new Employee();
      employee.Employee_Name = formCollection[&quot;Employee_Name&quot;];
      employee.Employee_Age = Convert.ToInt32(formCollection[&quot;Employee_Age&quot;]);
      employee.Employee_Salary = Convert.ToInt32(formCollection[&quot;Employee_Salary&quot;]);
      employee.Employee_City = formCollection[&quot;Employee_City&quot;];
      
      EmployeeBuissnessLayer employeeBuissnessLayer = new EmployeeBuissnessLayer();
      employeeBuissnessLayer.AddEmployee(employee);
      return RedirectToAction(&quot;Index&quot;);
  }
  </code></pre>
  <p>I am getting error at line</p>
  <pre><code>employeeBuissnessLayer.AddEmployee(employee);
  </code></pre>
  <p>Please help I have tried a lot of solutions but none of them have worked.</p>