SAP Knowledge Base Article - Public

1214841 - How to pass a NULL parameter value at runtime using Visual Studio .NET


  • An application uses Crystal Reports for Visual Studio .NET as the reporting development tool. 
  • The application uses a report based on a Microsoft SQL Server 2000 stored procedure that accepts NULL parameter values.
  • How do you pass a NULL value to a stored procedure parameter?



  • To pass a NULL value to a stored procedure parameter, set the 'Value' property of the ParameterDiscreteValue class to NULL/Nothing. For example: 

[VB.NET sample code]

Dim crParameterDiscreteValue As New CrystalDecisions.Shared.ParameterDiscreteValue()
crParameterDiscreteValue.Value = Nothing

[C# sample code]

CrystalDecisions.Shared.ParameterDiscreteValue crParameterDiscreteValue;
crParameterDiscreteValue = new CrystalDecisions.Shared.ParameterDiscreteValue();
crParameterDiscreteValue.Value = null;


DOTNET .NET PARAMETER NULL VBNULL EMPTY STOREDPROCEDERE SP ENGINE VB.NET Crystal Reports for Visual Studio Stored Procedure Parameters Passing NULL values , c2011736 , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , How To


Crystal Reports 2008 V1 ; SAP Crystal Reports 10.0 ; SAP Crystal Reports 2011 ; SAP Crystal Reports XI R2