Questions tagged «entity-framework-ctp5»

10
如何在存储过程中使用DbContext.Database.SqlQuery <TElement>(sql,params)?EF代码优先CTP5
我有一个具有三个参数的存储过程,并且我一直在尝试使用以下命令返回结果: context.Database.SqlQuery&lt;myEntityType&gt;("mySpName", param1, param2, param3); 最初,我尝试使用SqlParameter对象作为参数,但这没有用,并向其SqlException显示以下消息: 过程或函数“ mySpName”需要未提供的参数“ @ param1”。 所以我的问题是,如何在需要参数的存储过程中使用此方法? 谢谢。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.