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

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 [Amount] asc, [SalesmanId] asc;

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

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.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers