Wednesday, March 12, 2008

Damned if you Do Damned if you Don't

Wasting hours on a non-problem is frustrating to say the least.
Such is the case of not knowing about the CancelSelectOnNullParameter property of the ASP.NET 2.0 SqlDataSource control.

There was a time when if I wanted use a language / IDE I'd study a couple manuals cover to cover and Then dive in. While this was time and energy consuming, there was nothing like understanding your tools in their entirety to really solve problems in the most efficient manner. Well, I've gotten older and have a lot less time. My current method of solution discovery is trial and error. While frustrating & rewarding, it saves time in that I'm focused on the areas I believe I need to be in. I've used the SqlDataSource, GridView, FormView and most recently Telerik RadGrid Many times and never ran into a situation where the CancelSelectOnNullParameter was relevant. Now 2+ hours after I should have been on to the next section of the project I'm finally able to adequately test the BASICS of Data Access. I swear I thought I was losing it when the data grid wasn't showing up on a tested and working SqlDataSource. Why does the test work differently than the actual implementation?!?! No more bitching, but a HUGE thanks to ecbruck from the ASP.NET forums.

I'd post a thank you there, but they have the Most RETARDED (that is a medical and technical term not to be confused with salnder again the mentally challenged) non-passport login system! I forgot my password. Send me a link to a page to reset it, except I'm Denied Access to the reset page. WTF!!?!!? Ok. Now, no more bitching... for now.


So, in summary:

If your Gridview, RadGrid, DataReader, etc is not returning data when you KNOW it should be and its DataSource is a SqlDataSource (or AccessDataSource) and there are parameters with no value (null) being passed to it, it's probably because the CancelSelectOnNullParameter property is set to True (the default). Set to false and let the data flow again. I'm so frustrated right now.

Labels: , , , ,