?
Solved

Dynamic Sort Repeater

Posted on 2007-12-01
1
Medium Priority
?
602 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

752 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