Hi,
I have an application w/ n-tier design so I've never used the SqlDataSource up to this point but having to do my own sorting for GridViews is not something I want to keep dealing with. I'd like to take advantage of some of the packaged features too.
My question is: are there any purists out there who opted to use SqlDataSource. If so, what do you think about it? It's nice that SqlDataSource makes things simple but having data classes and dealing w/ exceptions in those classes certainly make an application pretty robust. Should I entertain the idea of using SqlDataSource or stay as a purist and keep doing things the old fashioned way?
If you are the only person working on the app, then using a SqlDataSource for relatively simple databinding so you can take advantage of the benefits it brings is fine, in my opinion. Mind you, you will lose the soubriquet of "proper programmer" and your friends will no longer want to talk to you. On the other hand, you can retain your purity by developing your own sorting and paging classes which can be as reusable as the SqlDataSource.
Purists would never use the SqlDataSource. They wouldn't be purists if they did. Would they?
Having said that, the ObjectDataSource isn't too difficult to configure for paging and sorting:
http://www.asp.net/learn/data-access/tutorial-44-vb.aspx
http://davidgardiner.blogspot.com/2006/06/objectdatasource-and-sorting-part-2.html
and you get to keep your credibility.
No comments:
Post a Comment