[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Dynamic Sort Repeater

Posted on 2007-12-01
1
Medium Priority
?
606 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 12

Accepted Solution

by:
Munawar Hussain earned 1000 total points
ID: 20387718
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

650 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