Question:

How do I read and write binary image data from SQL server?

by  |  earlier

0 LIKES UnLike

I'm making a website where visitors can upload their images, I've done the uploading code and it (probably) works fine because I can see the data is recorded on the database.

The problem is when I want to test it (display the image on the website) theoretically I have to read the data from the SQL server and write it to the web. I've done several ways and tests but all of them failed to display the image.

Anybody knows how to do this? I'm using visual web developer 2008 and VB.NET as programming language

Note: no "wizards" please, I want it to be implemented using fully coded like I did with the uploading code

 Tags:

   Report

2 ANSWERS


  1. The images will have to be rendered on the page via <img> tags using an HTTP transaction for their source.  You'll need to get the blob out of the database, set the type of the response to "img/{whatever type of graphic it is}," and then load the blob into the response.  How are you attempting to send it out now?


  2. http://www.dougv.com/blog/2008/08/21/dis...

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.