I was scratching my head trying to figure out how to automagically sort and page through a dataset in asp.net 2.0 without having to write my own custom code like I used to have to in .net 1.1. In my code behind I was calling my business object and then setting the datasource properties in the Gridview. I could not get the sorting and paging to work. It was driving me crazy. Then I read that you need to set the DataSourceID property of the GridView to a sqldatasource or objectdatasource.
So I created an objectdatasource and pointed it to my business ojbect function that was doing the search and returning a dataset. I set the parameters of the ObjectDataSource to use QueryString and then everything worked fine.
I then was able to delete all of the code in my code behind. Amazing. You can actually implement a fully functional GridView without writing any code in a code-behind page. I love it.