In EDMX Stored procedure returns int instead of result set- Entity Framework, .Net

Apr 11, 2019 BY xtreme

A CUSTOM FUNCTION

Some time Entity framework not able to decide, what should be returned by the procedure, specially when we use some temporary tables or dynamic queries inside store procedure. we can manage this EITHER of following ways- 

Solution 1: Modify your Stored Procedure
Set this at the top of your stored procedure
SET FMTONLY OFF
ALTER PROCEDURE [dbo].[rpt_commission] 
AS	
BEGIN
	SET FMTONLY OFF
    ...
END


Solution 2:

Manage Stored procedure return type directly in EDMX Model browser

1. Move to your .edmx

2. At Model Browser Window/Function Imports find your procedure then double click it

3. Change the return type to you want

4. Save .edmx and check the return type again.




Related