Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4616182
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:56:44+00:00 2026-05-22T01:56:44+00:00

I have a database of 9 images, which keep changing, so I cannot directly

  • 0

I have a database of 9 images, which keep changing, so I cannot directly set the src in html <img> tag to display the 9 images, I have to pick them from the database and bind them accordingly.

I’m able to retrieve and print 1 image using Response.BinaryWrite(), but not all 9. My byte[] gets only the 1st image from the db,

here’s the code,

            while (dr.Read())
            {
                Response.ContentType = "image/jpg";
                Response.BinaryWrite((byte[])(dr["fsImage"]));

            }

How do I retrieve all 9 images, and how do I bind them to either <asp:Image> tag or construct an html <img> tag dynamically

I’m a novice, so please take it easy on me, if there are stupid mistakes 😉

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T01:56:45+00:00Added an answer on May 22, 2026 at 1:56 am

    You can’t have the web page give the content of all the images.

    In order to “dynamically” render the image you need to make a page which will give you a single image. This page would use code like what you have above.

    Then to pick which image to show the url to the page would change for example

    http://youdomain/makeimage.aspx?imageid=1
    

    and

    http://youdomain/makeimage.aspx?imageid=2
    

    The code in make image would then return the single image.

    A note — you will be much happier if you make the url

    http://youdomain/makeimage.aspx?imageid=1&mytype=.jpg
    

    Thus having the image url end in the extension. Some browsers (IE) cheat and look at the end of the string to see what content type to expect. They will work with a url like above but not without the trialling .jpg.

    Also, you will need to implement some form of caching our your performance will be a dog (esp if you try to scale.)

    Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this script that displays all the users images which i will display
Learning php! I have a sql database which contains a table called 'images' which
I am having problems displaying images which have been queried from the database. The
I have been trying to load images which are in database(on local phone) .JSON
I have a experiment which displays the random images from the database and the
I have a database that stores images which can be access via a primary
I have a database which stores .png images as the sql image type. I
I have a database to which I upload files (such as PDFs, images, etc).
I have a very simple ASP.NET MVC site which displays images from the database.
I have the following listbox below which binds to a database table of image

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.