Monday, January 12, 2009

Help! Anyone got any ideas? SET DATEFIRST statement requires integer parameter.

Can anyone spot what I'm doing wrong?

I have this StoredProcedure which I'm trying to call using Linq to SQL from C# under 3.5 SP1 - using generated code from a visual .dbml designer.

CREATE PROCEDURE [dbo].[MyPrefix_GetActivities] (
    @TheStartDate       datetime,
    @TheEndDate datetime,
    @TheUserId int,
    @WeekDateFirst           int)
AS
BEGIN

    set datefirst WeekDateFirst;

    SELECT {snipped - but includes DATEPART(wk)}

END


When I run the stored proc in an SQL debugger it works fine

When I try to call the stored proc from C# using Linq I get a Sql Exception - SET DATEFIRST statement requires integer parameter.

Anyone got any help or suggestions? Thanks for any clues!

Posted - http://social.msdn.microsoft.com/Forums/en-US/linqtosql/thread/e279ae30-bd50-4371-9316-8549cbefc18b - but with no sign of any replies yet....

No comments:

Post a Comment