In the past weeks I've been posting some detailed information about how the ObjectDataSource works in ASP.NET 2.0. Here's a summary of what was posted:
Part 1 - The basics
Part 2 - Paging, Sorting, Parameters and Events
Part 3 - Optimistic Concurrency, parameter merging, caching and design time attributes
In those posts I pointed out some limitations or problems with the ObjectDataSource control. The only real solution here its to code your own data source control but it isn't an easy task.
I'll summarize here the most important problems/limitations of the ObjectDataSource IMHO:
* Having to write a SelectCountMethod when your data source does support paging.
* All calls to the methods specified by the XXXMethod properties are made using reflection but the reflection data isn't cached so for medium/big applications this could be a bottleneck.
* It can't be extended without having to rewrite almost all of it.
* The control can't be used in some cultures because of the conversions from that it makes using the invariant culture instead of the current culture.
* The AffectedRows property is very important in order to get the GridView working properly so it's a pain to have to handle the inserted, updated and deleted events every time you use the ObjectDataSource.
* Filtering support is minimal and reserved only if you return a DataSet, DataTable or DataView.
* The cache doesn't support neither filtering nor paging.
* If you're using custom objects you can change the parameter dictionary for the insert, update or delete methods.
* There's no source code available to make little tweaks to the ObjectDataSource in order to adapt it to how you work instead of you adapting of how it works.
As I was very unhappy with the ObjectDataSource I coded my own data source control based on the ObjectDataSource but with a lot of improvements. As this wasn't a trivial job and required quite a few time, I decided to spend some more time on it to make it a commercial product. Take a look here for all the features of this new data source control:
I have to remark that the control was designed to be very extensible so if you ever wanted something more than the ObjectDataSource you could save yourself typing and testing more than 10000 lines of code:
I hope you find it useful. Feedback is welcome.
You can access to the other parts here:
ObjectDataSource in Depth (Part 1)
ObjectDataSource in Depth (Part 2)
ObjectDataSource in Depth (Part 3)