I have moved my blog to a new hosting company. All images, posts and pages have been moved. I’ve also used a new source code syntax highlighter, so my software development posts should be a bit easier to read.
I came across what is, in my opinion, an absurd default value for something on the SqlDataSource today.
What I was trying to do was to call a table based UDF with a number of parameters, some of those parameters could be left as null and default values would be applied in the select within the UDF.
I spent some time debugging the code, then I tried profiling the SQL server and to my surprise nothing was actually being fired at the SQL server. So, I manually tweaked the parameters whilst on a breakpoint just before my database call. It worked, I got my expected result. Then just before I was about to re-code my UDF to cope with empty strings rather than nulls I did a quick search on google for “SqlDataSource + null parameters” and I stumbled across a forum post detailing a parameter to the SqlDataSource itself called CancelSelectOnNullParameter.
So, I set that to false on my SqlDataSource any hey presto is worked.