ASP 101 - Active Server Pages 101 - Web01
The Place ASP Developers Go!

Please visit our partners

Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates














ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash




Script Output:

SQL Query: SELECT * FROM [sales] ORDER BY [SalesmanId] asc;

SalesmanId (+ / -) Timestamp (+ / -) Amount (+ / -)
1 7/23/2002 11:43:00 AM 3000
1 7/24/2002 11:43:00 AM 2000
2 7/24/2002 11:43:00 AM 3000
2 7/23/2002 11:43:00 AM 3250
3 7/23/2002 11:43:00 AM 1200
3 7/24/2002 11:43:00 AM 2045
4 7/24/2002 11:43:00 AM 3085
4 7/23/2002 11:43:00 AM 1600
5 7/23/2002 11:43:00 AM 2000
5 7/24/2002 11:43:00 AM 3290
6 7/24/2002 11:43:00 AM 4900
6 7/23/2002 11:43:00 AM 1520
7 7/23/2002 11:43:00 AM 1840
7 7/24/2002 11:43:00 AM 2000
8 7/24/2002 11:43:00 AM 2700
8 7/23/2002 11:43:00 AM 1560
9 7/23/2002 11:43:00 AM 2140
9 7/24/2002 11:43:00 AM 1310
10 7/24/2002 11:43:00 AM 2075
10 7/23/2002 11:43:00 AM 1600
11 7/23/2002 11:43:00 AM 2150
11 7/24/2002 11:43:00 AM 3490
12 7/24/2002 11:43:00 AM 2340
12 7/23/2002 11:43:00 AM 1230
13 7/23/2002 11:43:00 AM 1360
13 7/24/2002 11:43:00 AM 1390
14 7/24/2002 11:43:00 AM 3245
14 7/23/2002 11:43:00 AM 1100
15 7/23/2002 11:43:00 AM 1900
15 7/24/2002 11:43:00 AM 4810
16 7/24/2002 11:43:00 AM 2710
16 7/23/2002 11:43:00 AM 1340
17 7/23/2002 11:43:00 AM 1320
17 7/24/2002 11:43:00 AM 3500
18 7/24/2002 11:43:00 AM 1355
18 7/23/2002 11:43:00 AM 2610
19 7/23/2002 11:43:00 AM 3210
19 7/24/2002 11:43:00 AM 2655
20 7/24/2002 11:43:00 AM 3220
20 7/23/2002 11:43:00 AM 3150
21 7/23/2002 11:43:00 AM 750
21 7/24/2002 11:43:00 AM 4000
22 7/24/2002 11:43:00 AM 4000
22 7/23/2002 11:43:00 AM 420
23 7/23/2002 11:43:00 AM 980
23 7/24/2002 11:43:00 AM 4000
24 7/24/2002 11:43:00 AM 2400
24 7/23/2002 11:43:00 AM 565
25 7/23/2002 11:43:00 AM 2100
25 7/24/2002 11:43:00 AM 1690
26 7/24/2002 11:43:00 AM 3000
26 7/23/2002 11:43:00 AM 2580
27 7/23/2002 11:43:00 AM 2450
27 7/24/2002 11:43:00 AM 2050

ASP HTML Download            FAQ

ASP.NET Version

This works just like our Database Sort sample except it adds the ability to sort by multiple fields. I attached it to a different table (one that had multiple records with the same value in some fields) so that you could see it actually working.

The last field clicked is the highest priority sort. So if you want to see the entries sorted by SalesmanId (Ascending) and then by the Amount of the sale (Ascending) you would click on the + next to the Amount heading and then by the + next to the SalesmanId heading.

The script will go back as many sort criteria as you want but it removes duplicates so if you sort by SalesmanId Ascending and then by SalesmanId Descending, only the last desc is passed to the database.

The only real thing missing is some sort of pretty indicator telling you the current sort sequence, but, if you hadn't already noticed, UI design isn't really our thing... we'll leave it to you.


Samples

Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM eBook: Planning a Service Oriented Architecture
IBM eBook: Choosing the Right Architecture--What It Means for You and Your Business
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Avaya Article: Using Intelligent Presence to Create Smarter Business Applications
Intel Go Parallel Article: Getting Started with TBB on Windows
Microsoft Article: 7.0, Microsoft's Lucky Version?
Avaya Article: How to Feed Data into the Avaya Event Processor
IBM Article: Developing a Software Policy for Your Organization
Microsoft Article: Managing Virtual Machines with Microsoft System Center
Intel Go Parallel Article: Intel Threading Tools and OpenMP
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
HP Video: StorageWorks EVA4400 and Oracle
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Red Gate Download: SQL Toolbelt and free High-Performance SQL Code eBook
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
Silverlight 2 App and Walkthrough: Leverage Silverlight 2 with SQL Server and XML
IBM Article: Enterprise Search--Do You Know What's Out There?
HP Demo: StorageWorks EVA4400
Microsoft Article: The Progress and Promise of Deep Zoom
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES