asp.net - Error when trying to run a stored procedure from my C# code -
asp.net - Error when trying to run a stored procedure from my C# code -
i have next stored procedure:
create procedure listquestionids @examid int begin select question.questionuid objective inner bring together objectivedetail on ( objective.objectiveid = objectivedetail.objectiveid ) inner bring together objectivetopic on ( objectivedetail.objectivedetailid = objectivetopic.objectivedetailid ) inner bring together problem on ( objectivetopic.subtopicid = problem.subtopicid ) inner bring together question on ( problem.problemid = question.problemid ) objective.examid = @examid; end;
i using ef6.1 , have db context. here how trying phone call stored procedure:
var b = db.database.sqlquery<string>("dbo.listquestionids", 1);
it's giving me error saying expects parameter @examid none supplied.
can tell me doing wrong?
this should solve problem
db.database.sqlquery<string>("dbo.listquestionids @examid", new sqlparameter { parametername = "examid", value = 1 });
c# asp.net sql-server entity-framework
Comments
Post a Comment