Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Do While Loop Not Looping
Old 11-22-2004, 11:53 AM Do While Loop Not Looping
barbara's Avatar
Skilled Talker

Posts: 79
Trades: 0
Below is my code for looping through the database:

<% Do While NOT RS.EOF
if len( trim(rs.Fields("CompanyName"))) > 0 then %>

<b><%=strCoName %> </b> <br>
<%=strConName %> <br>
<%=strAddress%> <br>
<%=strCity%> &nbsp; <%=strState%>&nbsp;&nbsp;<%=strZip%> <br> <br>
<br><br>
<p>Test Request: <%=strWhichTest%> <br>
<%=strDesc%> <br>
<p>Test Method:</p><%=TMethod%> <br>
<p>Notes:</p><%if TestNotes <> "" then %>
<%=TestNotes%>
<%end if%> <br>
<p><u>Results:</u></p>
<table border="0" width="90%" cellspacing="1" cellpadding="0">
<tr>
<td width="14%" align="center">Sample</td>
<td width="14%" align="center">Sample2</td>
<td width="14%" align="center">Sample3</td>
<td width="14%" align="center">Sample4</td>
<td width="14%" align="center">Sample5</td>
<td width="14%" align="center">Sample6</td>
<td width="14%" align="center">Average</td>
</tr>
<tr>
<td width="14%" align="center"><%=dblSample%></td>
<td width="14%" align="center"><%=dblSample2%></td>
<td width="14%" align="center"><%=dblSample3%></td>
<td width="14%" align="center"><%=dblSample4%></td>
<td width="14%" align="center"><%=dblSample5%></td>
<td width="14%" align="center"><%=dblSample6%></td>
<td width="14%" align="center"></td>
</tr>
</table>
<%end if
RS.MoveNext
Loop

%>

It does not gives me any error message, but i only get the first customer from the database and it is displaying the same customer twice (since i only input two customers for testing purposes.)

thanks
barbara is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-22-2004, 05:27 PM
foobar's Avatar
Extreme Talker

Posts: 225
Trades: 0
Try using a Do Until loop instead of a Do While.
foobar is offline
Reply With Quote
View Public Profile Visit foobar's homepage!
 
Old 11-24-2004, 02:09 PM
ACW
Average Talker

Posts: 26
Trades: 0
Are you setting your variables (strCoName, strConName, strAddress, strCity, strState, strZip, etc.) before the loop with the info for the first company?
__________________

Please login or register to view this content. Registration is FREE
by Geo Redundant Hosting
ACW is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Do While Loop Not Looping
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13504 seconds with 12 queries