I am trying to execute a stored procedure from EF5 using Database.SqlQuery. But 2nd parameter is not recognizing here.
Error: "The parameterized query '(@custNum nvarchar(7), @PrimaryDisc bigint, @SecondaryDisc bigint)' expects the parameter '@PrimaryDisc', which was not supplied."
Code
var results = _MiscContext.Database.SqlQuery<TempTechDisciplines>(
"exec sp_getTechnicalDiscipline @CustNum, @PrimaryDisc, @SecondaryDisc",
new SqlParameter("custNum", CustomerNum),
new SqlParameter("PrimaryDisc",SqlDbType.BigInt, 0),
new SqlParameter("SecondaryDisc",SqlDbType.BigInt, 0))
.ToList<TempTechDisciplines>();
What is the issue here?
@while adding parameter names like :new SqlParameter("@custNum", CustomerNum),@CustNum, but the parameter is namedcustNum.new SqlParameter("@PrimaryDisc", new BigInteger(0)).