Not sure if phrasing this right, seems simple but not sure best way to do it. Basically, I’ve got a simple database identifying items of clothing. Just ItemID(PK), ItemName and ItemLink(just the name of the jpeg for that item, which I’ll use in .net to construct the correct image url for that item).
Client doesnt want anything fancy, just to click up and down and have the page move thru the DB simply displaying next and previous itenms. So in my SQL procedure, I always just want to access the next image in the DB. I can’t figure how to do this without adding an extra column that just displays position in the DB, something like just numbering from 1 to whatever (probably about forty or so images). Start out with ‘1’ on the first page load, store that as a session variable (or cookie), and iterate thru that way? Seems like should be something cleaner.
Depending on how many images your database contains, it would be create an image object with ID, Name and Link.
Then when page loads get all images from database and create a list of image objects.
This way when user clicks next / previous buttons you can just move forward or backward in the list.
Would mean storing a bit extra in memory but only one trip to the database.
If you need a code sample just let me know 🙂