Solved

Display Image in Datalist from Database

Posted on 2014-01-13
3
228 Views
Last Modified: 2014-02-12
I have several hundred employee records in a database which contain routine data like first name, last name, title, and employee photo. The photos are stored in the database table using type (image) along with other data such as name, title, etc.  The photos need to be displayed on a search results page, along with the other relevant employee info.

What I need to do is bind the data from the database into a dataList, which I have done a million times before using just text, but have never had to serve up an image before.  Looking at the "image" control I have placed on my page which should display the employee photo, I'm not quite sure how (or where) to bind it to the photo.

These photos will be called up "on-demand" and are not physically stored in a directory anywhere, so it doesn't seem appropriate to use the ImageUrl property to bind.  Am I using the wrong control? Not sure how to start with this.

I have found a handful of articles on how to convert binary to image, but not sure if that's applicable since these are stored in the "image" format.  

Any help would be much appreciated.
0
Comment
Question by:vcbertini
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
Surendra Nath earned 500 total points
ID: 39777958
0
 

Author Comment

by:vcbertini
ID: 39778013
In that article they never really specified how to do it without using an httphandler. I'm having difficulty integrating an httphandler because my project is set up not as a regular website project, but rather a series of layouts designed for a content management solution and I'm not 100% sure where to put the handler so it will compile properly. I had big problems with that today.
0
 

Author Closing Comment

by:vcbertini
ID: 39853909
I was able to write a Handler, but since we are working within the confines of a content management system, it was an extremely slow solution and didn't work out great. I ended up re-programming everything to pull the images from our content management system instead of the database.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now