Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

Dynamic table using images from SQL

I have an "almost working" pair of web forms coded in VS.NET that are supposed to work together and display, on the 2nd page, the description and corresponding images retrieved from SQL Server.  The problem is that I cannot seem to figure out how to get each successive image.  The 1st image displays repeatedly along side of the next description, and the 3rd, etc.  The first page uses a SqlDataReader only to get the images, and the 2nd page uses a second reader to get the description and ID field for each record in the table.  This sounds a little redundant to me, but it's supposed to work. This is from a book chapter (book info available upon request), and I'm still trying to figure it out, but am unsure how to get it working correctly.  Even the code provided doesn't work.  Existing code is available along with the table structure, etc. This is in C#.  Any takers.  It seems pretty cool.

Michael Lockwood
Saturday, March 06, 2004

I can only imagine that the 2nd page is the one that actually serves up the image (all you can put in HTML are <img> tags (ie you can't really 'embed' images) which refer to external files - in this case the 2nd page). The images are stored in the database right? Also I imagine that the 2nd page gets passed a QueryString parameter telling it which image to serve up. So, is this being set by the 1st page, and read (using Request["param"] or Request.QueryString["param"]) by the 2nd page? right click the images and go to Properties and see what URL is used to get the image.

Without more information, and without seeing the code it's tricky to remotely debug!

PS: are you remembering to call DataBind()?
PPS: sounds like a crap book!

Duncan Smart
Sunday, March 07, 2004

*  Recent Topics

*  Fog Creek Home