我在一個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來自數據庫)。 –