none
System.NullReferenceException - stored procedure RRS feed

  • Question

  • I often (not everytime) get a System.NullReferenceException when running some specific stored procedure to get data. The exception is raised when trying to affect the value of the output parameter in a local variable. However, the procedures check for null : isnull (output, 0). So the application can not get a null value. I checked the paramters type and length (in C# code and SQL script) to be sure they match. I don't understand. Any help please ?
    Wednesday, August 27, 2014 12:25 PM

All replies

  • Hello Allie,

    >>The exception is raised when trying to affect the value of the output parameter in a local variable

    Currently, we cannot know what has happened, if you could provide some related code and describe how this error occurs, I think it would be better for us to help you.

    >> However, the procedures check for null : isnull (output, 0). So the application can not get a null value.

    To help narrow this issue, I would suggest that you could debug the stored procedure to check if the return value is null, for debugging a stored procedure, you could follow this link:

    How to: Debug Stored Procedures

    If you find the returned value is not null, then I think you need to check your remain code if there are other reasons would cause this issue.

    Best Regards,

    Fred.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, August 28, 2014 3:13 AM
    Moderator