Tech Off Thread

3 posts

LINQ TO SQL Method Return Type Is Incorrect for a SP

Back to Forum: Tech Off
  • User profile image
    Secret​Software

    OKay,
        You have a stored procedure like this:
    Input = @L As Bit, @G As Bit.
    SELECT        X.*
    FROM            Y AS X
    WHERE        (X.D = @L AND @L IS NOT NULL) AND (X.T = @G AND
                             @G IS NOT NULL)
    ORDER BY X.U DESC

    Why does LINQ TO SQL make the return type int instead of ISingleResult?

  • User profile image
    JChung2006

    SET NOCOUNT ON causes stored procedures to return an int value.  Try SET NOCOUNT OFF in your stored procedure.

  • User profile image
    Secret​Software


    JChung2006 wrote:
    SET NOCOUNT ON causes stored procedures to return an int value.  Try SET NOCOUNT OFF in your stored procedure.


    But Its not set ON. Its off.

    Not sure why it keeps doing it.

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.