ASP.NET, SQLDataSources, and null parameters

Using a stored procedure in your SQLDataSource? Good! Trying to pass blank parameters? Trouble!

If your stored procedure needs to be able to accept null values or blank strings, set the CancelSelectOnNullParameter property of the data source to false.

Otherwise, passing an empty value to a parameter will cancel your data access, leaving you wondering why certain queries work and others don’t.

One Response

  1. Well said.

    Savannah - November 9th, 2008 at 9:58 pm

Leave a Reply