ASP 101 - Active Server Pages 101 - Web03
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

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

Whitepapers and eBooks

Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Microsoft PDF: Top 10 Reasons to Move to Server Virtualization with Hyper-V
Microsoft PDF: Six Reasons Why Microsoft's Hyper-V Will Overtake Vmware
Microsoft Step-by-Step Guide: Hyper-V and Failover Clustering
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Microsoft PDF: Top 11 Reasons to Upgrade to Windows Server 2008
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
  PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
HP eBook: Guide to Storage Networking
MORE WHITEPAPERS, EBOOKS, AND ARTICLES