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: , , , ,

Wednesday, November 28, 2007

'DropDownList' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value

Exception Details: System.ArgumentOutOfRangeException: 'DropDownList' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value

I've got a dropdownlist whose SelectedValue is bound to a sqldatasource whose dataset is dependent on the selected index of another dropdownlist. By the time the SelectedValue is bound, the other dropdownlist should already have the appropriate selectedIndex bound. I know this is just a matter of timing, but it's pretty frustrating none the less. To see that feedback was given and summarily ignored is downright infuriating.

Response provided from feedback:
"Thank you for submitting this suggestion. From the brief description you've provided, it's difficult to determine what's actionable here. If this is really a suggestion, can you provide a more detailed description of the scenario and what you would like to see improved? If you're experiencing a problem with the product, can you resubmit it as a 'code defect' and provide repro steps along with any example code that would enable us to repro the problem. You also mention that Microsoft is aware of the problem - is there a KB article or exisiting bug that you can reference? All of this will help us to determine what needs to be done."

Wow. That is one of the Laziest responses I've ever seen. And don't think the lack of an individuals name went unnoticed. Lazy AND Cowardly.

I felt a little better after reading this, and resolved myself to a codebehind solution (for the time being).

Addendum:
No problem should be posted without a usable solution. What's the point in finding this if it doesn't help or at least point you in the right direction.

I'm currently working with Telerik Controls which I like a lot, but they're based on existing MS components so their combobox, for example, inherits the same behavior. Here is an example from their documentation which should cover a wide range of issues similar to this one.

Labels: , ,

Tuesday, October 09, 2007

Upgrading ASP.NET Control Toolkit from Previous Version

Once again sharing, what may be to many, the obvious. Upgrading from a previous version of the ASP.NET control Toolkit?

Instructions here: http://asp.net/AJAX/AjaxControlToolkit/Samples/Walkthrough/Setup.aspx

It's only a link Right on the sample page. Second link in the Walkthroughs section.


Why can't I get over how unnecessarily convoluted this all seems. (Not the toolkit, MS current web dev strategy).

Labels: , ,