Advertisement

06.18.2008 at 10:28AM PDT, ID: 23496132
[x]
Attachment Details

Displaying 2 Records in 1 row before looping to the next row

Asked by mrroy69 in Programming for ASP.NET, SQL Query Syntax

Tags: .ASP

This is the current code. it only dissplays 1 colum in each row, I would like it to display 2 columns before it loop to the next row, for example. This is what currentlyhappens:

<tr>
<td> Blah<?td>
</tr>
<tr>
.....

I would like for it to do this:

<tr>
<td>Blah</td> <td>Blah2</td>
</tr>
<tr>
........

SEE ATTACHED CODE SNIPLET:

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
<%
                    dim imagename,name,desc
                    dim rs,strSQL,pgnum,recCntr,rcp
                    strSQL = "SELECT a.fname,a.lname,a.adescription,a.imagename FROM TABLE a WHERE not a.lname is null ORDER by left(a.lname,3) ASC"
                    set rs = server.CreateObject("ADODB.RecordSet")
                    rs.Open strSQL,conn,1,3
                    pgCnt = (rs.RecordCount / 10)
                    
                    om = rs.RecordCount mod 10
                    if om <> 0 and rs.RecordCount > 10 then
                        pgCnt = pgCnt + 1
                    end if
                    recCntr = 0
                    rcp = 10'records per page
					pgNum = cint(Request.QueryString("pgNum"))
                    if pgNum = "" then
                     pgNum = 1
                    end if
                    if pgNum > 1 then
				      rs.move(pgNum*10 - 10)
				    end if
                    if not rs.EOF then
                      do while recCntr < rcp and not rs.EOF
                      imagename = rs("imagename")
                        fname = rs("fname")
                        lname = rs("lname")
                        desc = rs("Adescription")
                        desc = replace(desc,"""""""","""")
                      %>
                    
<td>
<IMG src="images/<%=imagename%>" width="165" height="130"><br><strong><%=fname%>&nbsp;<%=lname%></strong><br><%=desc%></td>
 
<%
rs.MoveNext
recCntr = recCntr +1
loop
end if
%>
[+][-]06.18.2008 at 10:48AM PDT, ID: 21815236

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Programming for ASP.NET, SQL Query Syntax
Tags: .ASP
Sign Up Now!
Solution Provided By: l-cm
Participating Experts: 1
Solution Grade: A
 
 
[+][-]06.18.2008 at 11:02AM PDT, ID: 21815354

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628