Solved

Display Image in Datalist from Database

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
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 …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

910 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

21 Experts available now in Live!

Get 1:1 Help Now