Null Parameters

  • Hi

    I have an existing store procedure that has 5 parameters, now when running this in sql I can put null values in any of the parameters e.g null,null,null,null,2864 and this returns results.

    Now when I try to run the store procedure in vb.net it will not accept the nulls even though in the report parameters I have ticked the box to allow nulls.

    Can someone please help

    Tracy

     

  • Can we get some more detail?

    Are you trying to call the report through a report viewer, from a custom interface via SOAP calls, using the url, etc?

    Have you tried running the report from Report Manager?

    Can you post the code that you are using to call the report, or to pass the parameters, if they are done separately?

  • I am pretty sure that VB.NET is converting the Nulls to Nothing which is not the same as null. You should check your parameters for Nothing in VB.NET and if they are nothing set the values to System.DBNULL.Value. For example:

    If parameter1 Is Nothing Then

    parameter1.Value = System.DBNULL.Value

    End If

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply