I have a gridview with a parameter. It is bound to a datasource which is a SQL query. The query returns rows when executed in SQL Server when the value of the parameter is null. When I try to pass the parameter a null value via the following line of code I get no results.
FormDS.SelectParameters["ServiceFormCompletedId"].DefaultValue = Request.QueryString["sfcId"];
The querystring does not exist so it passes a null value to the FormDS Datasource. The SelectParameters said it was a null value.
So I tried giving it an empty string.
FormDS.SelectParameters["ServiceFormCompletedId"].DefaultValue = "";
with the following in the markup of ASP.NET
<asp:Parameter Name="ServiceFormCompletedId" ConvertEmptyStringToNull="true" />
There was also no results.
I tested the Datasource with the following values in the Test Query section of the Configure Data Source and got rows back.
What am I missing about passing null values to the SelectParameters of a SqlDataSource?
