How To Programmatically Access the DataSet Created by a SQLDataSource
Posted on 2006-06-07
I noticed that when you use a SQLDataSource it will automatically do the sorting on the GridView for you which is great. I was however unable to figure out a way to add an Filtering expression to the SQLDataSource's dataView so that I could filter the returned data without using a SQLDataAdapter ---> dataSet ---> dataView, etc.
Using the SQLDataAdapter solved the filtering problem but then I lost the automatic sorting on the GridView Columns provided by the SQLDataSource so now I'm basically, trying to combine two different methods to cut down on the code I have to write.
If I stick with the SQLDataAdapter I'll have to write code to figure out which column the user clicked on and wants to sort. Any suggestions on ways to do this?
My preferred solution however is to programatically access the dataSet created by the SQLDataSource and simply filter on that and I would expect all of my problems will be solved.
Does anyone see a problem with this apporach and/or have suggestions on how to go about actually writing the code to accomplish this?
Thanks in Advance (TIA)