Well it seemed like it should work:
Visual Studio 2005, gridview, with three dropdownlists above the gridview allowing the user to select 1, 2, or 3 fields that would be fed into the ORDER BY clause of the SQLDataSource.
SQLDataSource has (simplified for this question):
Select fname, mname, lname,gender from people ORDER BY @sort1, @sort2, @sort3
<asp:ControlParameter ControlID="ddlSort1" DefaultValue="'' Name="sort1"
Error response back is:
The SELECT item identified by the ORDER BY number 1 contains a variable as part of the expression identifying a column position. Variables are only allowed when ordering by an expression referencing a column name.
Any ideas on a way around this ? I saw one reference that suggests coding a CASE statment within the SelectCommand.
thanks in advance