CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.club_web_site_starter_kit Tags:
Item Type: NewsGroup Date Entered: 3/28/2006 7:07:29 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 11 Views: 14 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
12 Items, 1 Pages 1 |< << Go >> >|
caleblan
Asp.Net User
cant view articles order by the latest to oldest3/28/2006 7:07:29 AM

0/0

good day people

i tried to view the articles by putting the order from the newest to the oldest. however, after trying to edit the stored procedures, i still failed to do so...(the starter kit displays it from the oldest to the latest)

anyone has any idea?  plz help...it's very urgent...thanks a lot

 

 

 

aabruzzese
Asp.Net User
Re: cant view articles order by the latest to oldest3/29/2006 3:42:17 AM

0/0

Hi caleblan,

Change your storedprocedure as follows:

<code>

set

ANSI_NULLS ON
set
QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[PagedAnnouncementList]
(
@pageNum INT = 1,
@pageSize INT = 10
)

AS

DECLARE @rows INT
DECLARE @keydate DATETIME
DECLARE @keyid INT
DECLARE @rowCount FLOAT /* yes we need a float for the math */

IF @pageNum = 1
 BEGIN
    SET @keydate= 0
     SET @keyid=0
  END
ELSE
BEGIN
/* get the values for the date and row */
 
SELECT @rows = (@pageNum-1) * @pageSize
  SET ROWCOUNT @rows
  SELECT @keydate=itemdate, @keyid=id FROM announcements ORDER BY itemdate DESC, id DESC
END

SELECT

@rowCount=COUNT(*) FROM announcements
SET ROWCOUNT @pageSize

SELECT id, itemdate, title, description, photo FROM Announcements
WHERE (itemdate > @keydate OR
(itemdate = @keydate) AND (id > @keyid))
ORDER BY itemdate DESC, id DESC
RETURN CEILING(@rowCount/@pageSize)

</code>

Once you have made this change, rebuild the site and you should be good to go.

The Stored Procedure in question is PagedAnnouncementList

 


AngeloA
caleblan
Asp.Net User
Re: cant view articles order by the latest to oldest4/5/2006 9:20:29 AM

0/0

hie there,

thanks for the reply, i'll try out the codes andi'll let you know the outcome later.

thanks a lot!!

caleblan
Asp.Net User
Re: cant view articles order by the latest to oldest4/5/2006 9:08:40 PM

0/0

hello again,

i tried the codes given above but i just realised that i already tried it before. Actually it displays it from the newest to the oldest but when it views the 2nd page or the following pages, it will view only the content of the first pages.

 

Let say i entered 20 items, it will only display the newest 10 articles on EVERY page.

Any idea to solve this prob? plz help

thanks again

 

aabruzzese
Asp.Net User
Re: cant view articles order by the latest to oldest4/6/2006 5:14:10 AM

0/0

 

 Hi Caleb,

The problem is that the paging functionality for the Repeater control is not intuitive, it needs to be coded and as it stands the Stored Procedure does not handle this.

The Params are hard coded right now, so basically it will always return 10 items and it will also drop 1 from page 2 or 3 etc..etc.

I am looking at this now that I have tested and recreated the problem.

But let's just say that I think the answer is to move away from a stored procedure and create a dataset, when you are doing paging with a repeater the main concern is the Start Key for the Page so when your sql executes you will get the proper results.

It is something to think about for a little while.

 


AngeloA
aabruzzese
Asp.Net User
Re: cant view articles order by the latest to oldest4/9/2006 2:35:25 AM

0/0

Ok I have fixed the issue with the NewsList and the Repeater.

You can see the results at:

http://67.164.255.166:8029/default.aspx

Now in my case, I changed it to 4 news articles per page as after testing this a little I thought that 4 is the best number otherwise the page looks cluttered.

You will have to click on the View All News Articles link to get redirected to the News_List.aspx page.

I converted the Page to use the CodeBehind Model and added proper paging through the News Articles.

 

 

 


AngeloA
aabruzzese
Asp.Net User
Re: cant view articles order by the latest to oldest4/9/2006 2:37:07 AM

0/0

Ok I have fixed the issue with the NewsList and the Repeater.

You can see the results at:

http://67.164.255.166:8029/default.aspx

Now in my case, I changed it to 4 news articles per page as after testing this a little I found 4 to be  the best number otherwise the page looks cluttered.

You will have to click on the View All News Articles link to get redirected to the News_List.aspx page.

I converted the Page to use the CodeBehind Model and added proper paging through the News Articles.

 

 

 


AngeloA
MrLunch
Asp.Net User
Re: cant view articles order by the latest to oldest4/10/2006 10:05:53 PM

0/0

Here's another version of that procedure which will show news articles newest first. Have a look at the procedures in the aspnetdb for some examples of page type procedures, for example aspnet_Membership_FindUsersByName
Note that one uses a zero based page index.

ALTER PROCEDURE PagedAnnouncementList
(
   @pageNum
INT = 1,
   @PageSize
INT = 10
)
AS
-- Set the page bounds
DECLARE @PageLowerBound int
DECLARE @PageUpperBound int
DECLARE @TotalRecords int
SET @PageLowerBound = @PageSize * (@pageNum - 1)
SET @PageUpperBound = @PageSize - 1 + @PageLowerBound
-- Create a temp table to put items in the order we want
CREATE TABLE #ItemIndex
(
   IndexId
int IDENTITY (0, 1) NOT NULL,
   NewsId
int
)
-- Insert into temp table
INSERT INTO #ItemIndex (NewsId)
SELECT a.id
FROM announcements a ORDER BY itemdate DESC, id DESC
-- Get the goodies

SELECT a.id, a.itemdate, a.title, a.description, a.photo
FROM Announcements a, #ItemIndex i
WHERE a.id = i.NewsId
AND i.IndexId >= @PageLowerBound AND i.IndexId <= @PageUpperBound
ORDER BY itemdate DESC, id DESC
-- Return the number of pages
SELECT @TotalRecords = COUNT(*)
FROM #ItemIndex
RETURN CEILING(@TotalRecords/@pageSize)


Mark Bracewell
Forums Starter Kit
Attila
Asp.Net User
Re: cant view articles order by the latest to oldest4/16/2006 3:03:03 AM

0/0

the last one works for me  thx for the tip 

 

best regards

caleblan
Asp.Net User
Re: cant view articles order by the latest to oldest4/20/2006 10:18:31 AM

0/0

thanx a lot ppl....everything works really fine....thanks...i appreciate all the help very much...
hcengiz
Asp.Net User
Re: cant view articles order by the latest to oldest10/4/2006 3:47:09 PM

0/0

I had about 15 records on the news, the above procedure works fine to view to first 10 of them. There is no way to proceed to the next page. 

Why don't we change this line to see the 2nd page? Worked fine!

RETURN CEILING(1+@TotalRecords/@pageSize)


If you don't behave in the way you believe,
then you start to believe in the way you behave.
Omar bin Khattab (peace be upon him)
ta4ka
Asp.Net User
Re: cant view articles order by the latest to oldest10/12/2007 12:55:48 AM

0/0

 awesome dude, thanks for the last tip, it seems to work greath now


----------------------------------------
http://www.shoutitonline.com/ - Website based on club site starter kit
Web Orange Design Solutions
http://www.web2orange.com
http://www.weborange.com.mk
12 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
The Latest Answers to the Oldest Questions: A Philosophical Adventure with the World's Greatest Thinkers Authors: Nicholas Fearn, Pages: 256, Published: 2007
A Dictionary of the Bible: Supplement (Articles) Authors: James Hastings, S R Driver, Pages: 756, Published: 2004
Sync: How Order Emerges from Chaos in the Universe, Nature, and Daily Life Authors: Steven Strogatz, Pages: 352, Published: 2004

Web:
Support Forum - FreeForums.org :: View topic - Administration ... Administration feature Newest First/Oldest First for posts ... Posted: Fri Mar 02, 2007 9:54 pm Post subject: Post order, Reply with quote ...
News articles from newest to oldest - ASP.NET Forums What do you have to change in order to get the news events to be listed with the newest article on top instead of the oldest article on the ...
Tortoise - Wikipedia, the free encyclopedia The oldest tortoise ever recorded, almost the oldest individual animal ever recorded, .... See main article Cultural depictions of turtles and tortoises ...
Payment Goes Through But Can't See Order - osCommerce Community ... Payment Goes Through But Can't See Order. Options V. destnj · View Member Profile. post Jun 11 2008, 05:43 PM. Post #1. Nick Destefano ...
Comments Sort Order Oldest First [Support Forums - Q and A ... Re: Comments Sort Order Oldest First. #2. Home away from home. Joined: 2003/7/5 20:13 ... You can view topic. You cannot start a new topic. ...
Slashdot | World's Oldest Rocks Found Sep 28, 2008 ... World's Oldest Rocks Found -- article related to Earth and Science. ... and in order to teach this truth it expresses itself in the terms of ...
Legalized Prostitution: Regulating the Oldest Profession However, one may have to temporarily suspend certain mores in order to fully appreciate the details of this view. As it is with many controversial articles ...
Letter from Southern France: First Impressions: Reporting & Essays ... What does the world’s oldest art say about us? ... admits in “The Cave Painters” that he can’t help reading a mythical narrative into the scene, ...
Cannot see oldest posts published in 2007 to edit labels - blogger ... Cannot see oldest posts published in 2007 to edit labels. Options ... in order to use the Labels feature correctly. I can only see posts ...
Why can the French award Australians a knighthood but our Queen ... Oct 16, 2003 ... Divid flint wonders why the Queen of Australia cannot award a knighthood to ... See what other readers are saying about this article! ...

Videos:
Collecting Meteorites in Antarctica Google TechTalks January 26, 2006 Dr. Monika Kress Dr. Kress was a member of the ANSMET 2003-04 Expedition. (ANSMET = Antarctic search for meteorit...
The Da Vinci Code: A Response Nicky Gumbel responds to the smash hit novel by Dan Brown.
Charlie Rose - Bashar Al-Assad From Damascus, an hour with the president of Syria, Bashar al-Assad.
WCN # 212 - World Chess News - ( Mitt i Schack ) This episode contains of: * FIDE Grand Prix in Sochi * Arcapita International Chess Championship * IX international Chess Open de Sants * The Europ...
Charlie Rose - Joe Paterno / John Feinstein Segment 1: A conversation about athletics and leadership with Joe Paterno, Head coach at Pennsylvania State University. Segment 2: Author John Feins...
Charlie Rose - Manmohan Singh, Prime Minister of India An exclusive conversation with Manmohan Singh, Prime Minister of India. This conversation will begin a week of interviews taped in India ahead of Pr...
Charlie Rose - Gay Talese / An Appreciation of Abe Rosenthal Segment 1: Author Gay Talese talks to guest host Ken Auletta. His new book is "A Writer's Life". Segment 2: We conclude with an appreciation of A...
Lucky Number Seven 777 פלאי השבע 7 Lucky Number Seven !!! פלאי השבע english subtitle הופעת המספר 7 פעמים כה רבות ביהדות ובבריאה, מעוררת השתאות. מהו סודו של ה-7 ? הכיצד יתכן שהיום השבי...
www.moldytoaster.com on. Illustration--ALTAR AND IMAGES. Central figure Akshobya, the first of the Pancha Boodha. The great or south temple contained a side altar of ve...
Long Beach City Council Meeting Long Beach City Council Meeting




Search This Site:










passwordrecovery error

binding a retrieved data field to the page title

tracking vistors with asp.net

add new localization/language

can you use filename parts as variables?

how can i show web parts based on a user role

how to load image into byte array from images directory

getuser() without changing users - webprofile bug?

dnn 2 final users online bug (still?)

login to my site

how to operate smtp server? need alot of help!

updating xml file error object reference not set to an instance of an object.

still unable to connect to msde sql server (sql server does not exist or access denied) :(

role management question

multi-controls

3.0.11; multiple portals issue

wizard control and overloading viewstate

how to use string values? i really need help for this. thanks.

setting asp.net version number using install projects

electronic signature in web forms

using sharepoint login instead of asp.net login ?

how can i use codebehinds instead of a .dll because i use dwmx

manually removing modules

error - the viewstate is invalid for this page - loging

simple equality question

sitemappath, multilanguage, web.sitemap and virtual directories

how to display aspx file in newly created tab-page instead of ascx

digital file security

counter value on page

roles authentication error

 
All Times Are GMT