我有一個存儲過程,我返回新的ID號。代碼如下所示:映射存儲過程時的「不支持的參數」? (EF)
ALTER PROCEDURE [dbo]. [Save Contact]
@FirstName varchar (50),
@LastName varchar (50),
@Email varchar (50)
AS
BEGIN
- SET NOCOUNT ON added to Prevent extra result sets from
- Interfering with SELECT statements.
SET NOCOUNT ON;
INSERT INTO Contacts (FirstName, LastName, Email)
VALUES (@FirstName, @LastName, @Email)
SELECT SCOPE_IDENTITY() as newid
END
當我嘗試映射我的存儲過程,我得到以下錯誤:
Error 1 Error 2047: A mapping function binding specifier a function demoModel.Store.SaveContact with an unsupported parameter: id. Output parameters May only be mapped through the RowsAffectedParameter property. Use result bindings to return values from a function invocation.
是否有任何人在這裏誰可以看到我是什麼做錯了?
需要更多的代碼,請讓我知道。
我沒有看到'在SP參數的任何地方id' ... – 2011-12-11 19:28:25
我已嘗試添加該ID,但它給出了相同的結果。 我無法更新帖子,但@newID int在那裏。 – SteelSoft