devxlogo

Prevent Empty Parameters from Automatically Converting to Null

Prevent Empty Parameters from Automatically Converting to Null

You can define parameters for the SqlDataSource control. If a parameter value is an empty string, the driver automatically converts that into a NULL value, which can lead to unexpected query resultsand sometimes to no query results at all.

To avoid this automatic conversion, set the ConvertEmptyStringToNull to equal false in the SqlDataSource control.

Here’s an example:

  

devx-admin

Share the Post: