I am calling a simple stored procedure written in SQL Server 2008 with the C # parameter, but it displays an error "The procedure or function 'AddYear' expects the parameter '@mYear' which has not been sent.
What is wrong with this code, I tried several things, but did not succeed.
SqlCommand AddEquip = new SqlCommand("AddYear", dbConn); SqlDataReader rdrEquip; SqlParameter mP = new SqlParameter("@mYear",SqlDbType.VarChar ) ; mP.Value = "1990"; AddEquip.Parameters.Add(mP); rdrEquip = AddEquip.ExecuteReader();
- The name and type of the parameter are the same as I use in the procedure.
source share