473,734 Members | 2,211 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Filling out the missing squares in my picture grid - HELP

Hi All

I know the subject sounds strange, but please bear with me.

Using ADO/ASP, I want to retrieve a list of pics from my db (which will be
dynamic number of pics as a user will be uploading anything from 1 to 12
pics) and put them in a grid (table) of say 3 x 4 cells.

I think this is easy to do if the user has uploaded 12 pics, as the
recordset's recursive loop will create the table for me, but my problem is
that what if they only upload 4, 5 or 7. How do I list these pics in my
grid, but get the ASP to neatly finish off the 3 x 4 grid? If I just leave
it to my recordset of say 7 recs then my 3 x 4 table is going to disjointed
and unfinished.

I hope this makes sense and hope you know of a way round it.

Many thanks.

Rgds

Laphan


Jul 22 '05 #1
2 1272
If Not rs.EOF Then
intCellMax = 3 ' Set to Column width you prefer
intCellCount = 0
With Response
.Write "<TABLE><TR >"
Do While Not rs.EOF
If intCellCount = intCellMax Then
.Write "</TR><TR>"
intCellCount = 0
End If
intCellCount = intCellCount + 1
.Write "<TD>"
.Write rs("WhatEver")
.Write "</TD>"
rs.MoveNext
Loop
If intCellCount < intCellMax And intCellCount > 0 Then
For i = (intCellCount + 1) To intCellMax
.Write "<TD>&nbsp; </TD>"
Next
End If
.Write "</TR></TABLE>"
End With
End If

'dlbjr
'Pleading sagacious indoctrination!
Jul 22 '05 #2
Many thanks dlbjr

I'll give it a go.

Rgds

Laphan
dlbjr <oo**@iforgot.c om> wrote in message
news:uN******** ******@tk2msftn gp13.phx.gbl...
If Not rs.EOF Then
intCellMax = 3 ' Set to Column width you prefer
intCellCount = 0
With Response
.Write "<TABLE><TR >"
Do While Not rs.EOF
If intCellCount = intCellMax Then
.Write "</TR><TR>"
intCellCount = 0
End If
intCellCount = intCellCount + 1
.Write "<TD>"
.Write rs("WhatEver")
.Write "</TD>"
rs.MoveNext
Loop
If intCellCount < intCellMax And intCellCount > 0 Then
For i = (intCellCount + 1) To intCellMax
.Write "<TD>&nbsp; </TD>"
Next
End If
.Write "</TR></TABLE>"
End With
End If

'dlbjr
'Pleading sagacious indoctrination!


Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3668
by: binger | last post by:
Okay, Superbowl is only a few days away, but I thought it would be cool to set up an online registration for a football squares pool. My thoughts are to have people go into anywhere on the 10x10 matrix and put their name in. If someone already has put their name in a square, then the text input box is now static (i.e. cant be overwritten)... Only problem - I'm not sure how to do this. I'd plan on using an
0
966
by: Jennifer | last post by:
I'm trying to fill a datagrid on a VB ASP web page. No data is showing up on my grid and I'm not sure why. The code is as follows Dim dvMain As DataView Dim X As Int16 Dim dtMain As New DataTable() Dim DR As DataRow
9
2289
by: totalgeekdom | last post by:
Background: The problem I'm trying to solve is. There is a 5x5 grid. You need to fit 5 queens on the board such that when placed there are three spots left that are not threatened by the queen. My thinking: I created a list, named brd, that represents the board. I made it such that brd would be the first square on the grid, and brd would be the bottom right end of the grid.
3
3752
by: Jive Dadson | last post by:
Hello folks. I know precisely zero about image processing. I want to draw a grid of lines one or two pixels wide on a picture (.jpg, .png, or whatever). I figure this is probably a very easy thing to do, but I can't seem to find the documentation I need. It all seems to assume you already know something. I have wxPython installed. I also have the wxPython demo. The section "Using Images/Image" looked promising. It just shows how...
1
1593
by: WayneM | last post by:
I have compact framework app that I was trying to test out on a windows form, but I cannot get past the very first step of simply filling a DataGrid from a DataSet. My code is Dim sqlStmt As String = "Select VendorName, StartWeek from InventorySchedule Where FinishDate is Null and StartWeek<'" & Now & "'" Dim cmdDB As New SqlCommand(sqlStmt, connDB) Dim dgridTarget As New DataGrid Dim adapter As New SqlDataAdapter() Dim ds As New...
1
999
by: zafar | last post by:
hi every one, In my database picture is saved, i am using sql server 2000 and VB.net 2005. When I search the record, I need that the picture should also be shown in the grid ( i am using ultra grid tool of infragestic)... thanx if any body can help me in this regards...
10
4635
by: wazzup | last post by:
C++ is new to me and I'm trying solve this problem but get stuck. Please help me out. Below is the task and after that is what i got so far. Create a program to print nested squares Input: Accept the width of the largest square Output: A series of nested squares with 1 space between them Sample: > eca4.exe 10 ********** * * * ****** *
5
12151
by: coolminded | last post by:
hi everyone i have a problem, i just export the data from data grid to the word file, but now the problem is i want to insert the picture in the word with the path name in the grid. for ex; i have three fields in the data grid 1 name 2. address 3 pic path i just exported the name, address and the path name of the picture but can't insert the actual picture.
3
8486
by: Screaming Eagles 101 | last post by:
Hi, is there an easy way to add a picture(box) to a column in a datagridview ? My first column has a code, ex. 1, 2 or 3 According to these codes I'dd like to add a picture(box) to my second column, just at the time when I show the data in the grid. I don't save the pictures in the database, I only use them when I show the data in the grid.
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.