我在一个Stored Procedure
中创建了多个查询。检查下面的例子:
即使用实体框架在一个存储过程中插入,更新和删除查询
IF(@Type='add')
BEGIN
Insert query
END
IF(@Type='get')
BEGIN
Select query
END
我在我的MVC
项目中使用Entity Framework
。所以,我收到错误:does not have a corresponding column in the data reader with the same name
。
是否需要为每个查询创建不同的Stored Procedures
?我如何实现我想要做的事情?
这是关于如何编写它的选择。 – Amit
你能告诉你如何设置'query'值吗? –
@ S.Dav我正在添加实体框架模型(Ado.NET实体数据模型和EF Designer来自数据库)。 –