Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases 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
 
Old November 10th, 2004, 05:11 PM
Authorized User
 
Join Date: Nov 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default Horizontal Records display

I want to display the redcords horizontally in a pair of three.

I meant to say that when i xtract data from the database my result should appear horizontally and not more then three results in a row...

How should i do it...plz if anyone can help me out..

I want the results to be displayed as below:


       Record1 Record2 Record3
       Record4 Record5 Record6

and so on.......
Plz Help..
Thanx

Farzan Q.
BS(TeleCommunication)
Iqra University.
__________________
Farzan Q.
MS(TeleCommunication)
Mohammad Ali Jinnah University.
 
Old November 11th, 2004, 04:51 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hey Farzan,

Try this...
Code:
Dim temp: temp = "<table><tr>"
Dim cols: cols = 3
Dim a: a = 0
Do Until rs.EOF
    If a > 0 Then
        If a Mod cols = 0 Then 
            temp = temp & "</tr><tr>"
        End If    
    End If    
    temp = temp & "<td>" & rs("myFieldName") & "</td>"
    rs.MoveNext
    a = a + 1
Loop
Response.Write temp & "</tr></table>"
HTH,

Chris

 
Old November 11th, 2004, 08:28 AM
Authorized User
 
Join Date: Nov 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by ChrisScott
 Hey Farzan,

Try this...
Code:
Dim temp: temp = "<table><tr>"
Dim cols: cols = 3
Dim a: a = 0
Do Until rs.EOF
    If a > 0 Then
        If a Mod cols = 0 Then 
            temp = temp & "</tr><tr>"
        End If    
    End If    
    temp = temp & "<td>" & rs("myFieldName") & "</td>"
    rs.MoveNext
    a = a + 1
Loop
Response.Write temp & "</tr></table>"
HTH,

Chris

Greetings Chris,

Thanx for taking interest in my query and letting me know the solution. I will try it and if i get trouble in doing that i will again post here plz do check back..thanx once again!

Farzan Q.
BS(TeleCommunication)
Iqra University.
 
Old November 11th, 2004, 04:59 PM
Authorized User
 
Join Date: Nov 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by ChrisScott
 Hey Farzan,

Try this...
Code:
Dim temp: temp = "<table><tr>"
Dim cols: cols = 3
Dim a: a = 0
Do Until rs.EOF
    If a > 0 Then
        If a Mod cols = 0 Then 
            temp = temp & "</tr><tr>"
        End If    
    End If    
    temp = temp & "<td>" & rs("myFieldName") & "</td>"
    rs.MoveNext
    a = a + 1
Loop
Response.Write temp & "</tr></table>"
HTH,

Chris

Hi Chris,

I did it..woo hooo..thanx alot...the way you tought me is so easy thati implemented it in my first try....
Hey could you plz help me in asp paging...do u have any easy code like above for paging....i hope you would help me in paging too:)

Thanx alot!

Farzan Q.
BS(TeleCommunication)
Iqra University.
 
Old November 12th, 2004, 10:54 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Farzan,

Not really sure what you're after.

For paging at it's most straight forward, I would run two queries, one to get the total results and another to get the actual results to display.

If the total results are greater than the number you want to show per page, you can create links to the various pages, forward / next etc.

What have you got so far?

Cheers,

Chris

 
Old November 14th, 2004, 07:20 AM
Authorized User
 
Join Date: Nov 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by ChrisScott
 Hi Farzan,

Not really sure what you're after.

For paging at it's most straight forward, I would run two queries, one to get the total results and another to get the actual results to display.

If the total results are greater than the number you want to show per page, you can create links to the various pages, forward / next etc.

What have you got so far?

Cheers,

Chris

Hey Chris..first of all thanx once again for visiting here and reading my post...

You understood what i want....
I want to display 5 records per page...after each five records there should be a link as you have mentioned NEXT or BACK...and i m sure you have seen written number of pages on many sites..like first 1 2 3 last...

Anyways...if you can let me know how to display specific number of records on a single page and then a link to next page for next 5 records...i will be thankful..if you had done in any previous projects??

I will be thankful

Have a ncie day!

Farzan Q.
BS(TeleCommunication)
Iqra University.
 
Old November 15th, 2004, 01:07 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Farzan,

You can search here on this forum for "Paging recordset" this was discussed many times here. That should help you in this.

Cheers!

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
display Records in ComboBox therese C# 2005 4 July 26th, 2008 05:28 AM
Display records in a table unmeshraut VB How-To 1 September 21st, 2007 12:04 PM
Asp.Net 2 Horizontal Menu Display Problem ivotive ASP.NET 2.0 Professional 1 December 15th, 2006 04:28 AM
how to display limited records per screen avats General .NET 2 June 4th, 2005 12:32 AM





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