Solved

Display Image in Datalist from Database

Posted on 2014-01-13
3
234 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

815 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

8 Experts available now in Live!

Get 1:1 Help Now