Solved

Dynamic Sort Repeater

Posted on 2007-12-01
1
584 Views
Last Modified: 2008-02-14
I am using a repeater control to format results from an MS SQL Table.  I would like to place some combination of dropdowns on the page to compose the sort order.  Then click a button to refresh the sort order as specified.  How do I update the selectcommand to change and update the ORDER BY.  OR if there is a better way to approach this, that would also be helpful.  (using the repeater is motivated by the resulting format I need to display)  Thank You
0
Comment
Question by:reinsmms
1 Comment
 
LVL 12

Accepted Solution

by:
needo_jee earned 250 total points
Comment Utility
In click event of Button (the one using to update repeater with newly selected order) .. change the Select command text with newly created QueryText with values from DropDownlists used for Order selection.

If you are using SqlDataSource then here is the way.
SqlDataSource1.SelectCommand= "SELECT COL1, COL2,COL3 FROM myTable where myTestID='" + Session["Userid"] + " Order by " + dropdownOrderBy.SelectedValue + ";

The above code tells how to update Query .. it is example not a working code sample.

Thanks
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video discusses moving either the default database or any database to a new volume.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now