Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 3rd, 2009, 06:01 AM
Authorized User
Join Date: Nov 2007
Location: , , .
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default To display the banners in sequential manner

I want to display the banners in a sequential manner instead of displaying it randomly.Say for eg if there are 3 records then it should display 1st then 2nd and then 3rd. Following is the stored procedure which displays the banner randomly.But I want it in sequential manner.


ALTER procedure [dbo].[sp_RandomBanner]
Declare @rows int
Declare @nRandNum int
create table #TempTable
dtPostDate datetime,
vchrLinkURL varchar(100),
vchrImagePath varchar(100),
vchrImageName varchar(50),
vchrStatus varchar(50),
vchrChangeStatus varchar(50),
intBannerID int identity(1,1)
Select dtPostDate, vchrLinkURL, vchrImagePath,vchrImageName,vchrStatus,vchrChangeS tatus From tblBanner where vchrStatus='Running'
select @rows=count(*) from #TempTable
select @nRandNum=Round(((@rows - 1) * Rand() + 1), 0)
select * from #TempTable where intBannerID=@nRandNum and vchrStatus='Running'


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
To display the banners in sequential manner jijish SQL Language 3 January 4th, 2009 05:42 PM
sequential transformations alexan XSLT 0 July 24th, 2008 11:59 PM
Chapter 8: User Controls - Shows all banners VeganMan BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 April 9th, 2008 03:45 PM
HELP!!!!! Sequential DTS e_cabrera_g SQL Server DTS 1 October 11th, 2006 11:54 AM

All times are GMT -4. The time now is 12:41 PM.

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