I can't seem to read this into Entity Framework and use LINQ because I get this error:
The return types for the following stored procedures could not be detected. Set the return type for each stored procedure in the Properties window.
I tried googling but the solutions seem way out of my head.. any ways I can get around this? desperate =[
The only way I can think of making this work is to create a new table.. but I can only use stored procedures unfortunately
ALTER PROCEDURE [dbo].[GetGame_FantasyHome]
-- Add the parameters for the stored procedure here
@GameDate varchar(8),
@TricodeHome varchar(3)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
CREATE TABLE #FantasyHome(
GameKey int,
PlayerName varchar(50),
Tricode varchar(3),
StatString varchar(50),
Position varchar(20),
FantasyScore int
)
DECLARE @gameKey int
SET @gameKey = (SELECT GameKey FROM Games WHERE GameDate=@GameDate
AND TricodeHome=@TricodeHome)
INSERT #FantasyHome
SELECT TOP 1 p.GameKey, p.PlayerName, p.Tricode, p.StatString, p.Position,
(p.Yards/25 + p.Touchdowns * 6 - p.Interceptions * 2) AS FantasyScore
FROM GamePassers AS p
WHERE p.GameKey=@gameKey AND p.Tricode=@TricodeHome
ORDER BY FantasyScore DESC, p.Yards DESC
SELECT *
FROM #FantasyHome
ORDER BY FantasyScore DESC
DROP TABLE #FantasyHome
END