Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 24th, 2009, 09:30 AM
Authorized User
 
Join Date: Mar 2007
Location: , , Denmark.
Posts: 52
Thanks: 6
Thanked 2 Times in 2 Posts
Default ArticleListing - Order By...

In TheBeerHouse, the articles in ArticleListing are listed with the newest entry first. I expect this is because of the Order By ReleaseDate DESC clause in the SP. However, If I change this to Order By ReleaseDate ASC, the articles are still listed as before. TheBeerHouse use a GridView in ArticleListing.

In my Blog application, I use a ListView in the ArticleListing control, and I use the same Order By ReleaseDate DESC in my SP, but my articles are listed with the oldest first... Changing the Order By clause has no effect. Whether I use paging or not has no effect either

Is the order defined somewhere else?
  #2 (permalink)  
Old March 24th, 2009, 10:01 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

philthy,

can't remember the TBH sp's/sql that well but it could well be that the cache hadn't expired after you made the change and therefore you were still getting the 'old' list from the BLL, rather than the refreshed DAL->BLL list...

just a thought...
__________________
jimi

http://www.originaltalent.com
  #3 (permalink)  
Old March 24th, 2009, 10:36 AM
Lee Dumond's Avatar
Wrox Author
Points: 4,942, Level: 29
Points: 4,942, Level: 29 Points: 4,942, Level: 29 Points: 4,942, Level: 29
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Ditto to what Jimi said; that was my first thought.
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
  #4 (permalink)  
Old March 24th, 2009, 01:44 PM
Authorized User
 
Join Date: Mar 2007
Location: , , Denmark.
Posts: 52
Thanks: 6
Thanked 2 Times in 2 Posts
Default

I was thinking of cache issues too, but I just assumed that it would work "out of the box" so to speak, if I kept the order by clause as Order By ReleaseDate DESC, just as in TheBeerHouse. Ill try playing around a little and write back...

Thanks guys...
  #5 (permalink)  
Old March 24th, 2009, 04:55 PM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

philthy - it won't work 'out of the box' in this way as your edits were code edits, rather than data edits.

frustrating stuff i grant you and an area that i've addressed by creating a master 'reset' across the cache when i'm testing projects for this very reason.

so you see, 'you're not alone'!!
__________________
jimi

http://www.originaltalent.com
  #6 (permalink)  
Old March 25th, 2009, 07:40 AM
Authorized User
 
Join Date: Mar 2007
Location: , , Denmark.
Posts: 52
Thanks: 6
Thanked 2 Times in 2 Posts
Default

Ok, I'm not sure if I dare to tell what was wrong here. Turns out the error was located a couple of feet from the keyboard...

Since I'm still testing my application, every time I added a new article, I just entered the same release date, because it was easier to just click on the textbox and enter the previous value. As a result, all articles had the same release date, and thats why the newest entry came in last on the list..

Go ahead, laugh all you want...
  #7 (permalink)  
Old March 25th, 2009, 08:28 AM
Friend of Wrox
Points: 894, Level: 11
Points: 894, Level: 11 Points: 894, Level: 11 Points: 894, Level: 11
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2005
Location: London, , United Kingdom.
Posts: 166
Thanks: 2
Thanked 33 Times in 33 Posts
Default

OK then,


Don't worry, you're not a proper programmer until you've done something totally dumb. Welcome to the elite
  #8 (permalink)  
Old March 25th, 2009, 08:38 AM
Authorized User
 
Join Date: Mar 2007
Location: , , Denmark.
Posts: 52
Thanks: 6
Thanked 2 Times in 2 Posts
Default

Well, in that case, I must be really good

Thnx
  #9 (permalink)  
Old March 25th, 2009, 09:32 AM
Lee Dumond's Avatar
Wrox Author
Points: 4,942, Level: 29
Points: 4,942, Level: 29 Points: 4,942, Level: 29 Points: 4,942, Level: 29
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Quote:
Originally Posted by philthy View Post
Ok, I'm not sure if I dare to tell what was wrong here. Turns out the error was located a couple of feet from the keyboard...

Since I'm still testing my application, every time I added a new article, I just entered the same release date, because it was easier to just click on the textbox and enter the previous value. As a result, all articles had the same release date, and thats why the newest entry came in last on the list..

Go ahead, laugh all you want...

Okay, so this was my SECOND thought...
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}


Similar Threads
Thread Thread Starter Forum Replies Last Post
ORDER BY Help U.N.C.L.E. SQL Server 2000 13 September 2nd, 2008 09:07 PM
Order of Skills misom99 JSP Basics 3 October 16th, 2007 09:05 AM
Sorting with ArticleListing.ascx BradenBR BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 February 15th, 2007 11:55 PM
ArticleListing control Koleraba BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 December 12th, 2006 11:42 AM
document node order vs sort node order. ladyslipper98201 XSLT 2 June 5th, 2003 11:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.