Microsoft provides a very simple layer between the web interface (asp.net 2.0) and the database. The object they use to perform this is the SqlDataSource. It works very well in many cases. It’s fast, easy to use and great for demonstration of technology and to show how fast you can program database type applications. It falls apart (IMHO) when the application starts getting larger and requiring more customization. It’s also very hard to maintain because at the end of the day, it puts most of what it does in the aspx page itself.

The ObjectDataSource on the other hand completely abstracts the web interface from the database. This means that you can completely isolate the web interface from directly going against data tables. Because this layer sits between the web and the database, it allows for complex transformations of incoming data to the back end databases. This would be near impossible (and unreadable) with the SqlDataSource.

In general, the bad news about ObjectDataSource’s is that they are bulky to program. Lots and lots of repetition, lots of attribute lists and lots of chances to make small mistakes that are hard to find. This being the case, it is just screaming out for some kind of code generator and hence the name, “Pain Free ODS Generator”

Who This is For
The Pain Free ObjectDataSource Generator (PF ODS Gen) is for engineers who just read the Why part above and knew exactly what I was talking about. It’s for engineers who know how to build ObjectDataSources from scratch but currently only do so when absolutely necessary because of what a pain they are to build.

PF ODS Gen is for engineers who know c# well. Engineers that feel completely comfortable inserting method calls into existing classes when necessary, understand OO programming and easily debug database type applications. It also assumes that the engineer is comfortable writing low level database code (ADO) and that when things don’t work as expected, they can look at the source and figure out why.

And finally, it’s for C# programmers because I know almost no VB.

Download pdf Pain Free ASP.NET 2.0 ObjectDataSource Generation