1

I have a search page that a user can use to search for certain information about a device (ex. computer) that has been entered into a SQL database. They can search for Brand, Type, Hard Drive Capacity and other things. Once they click the search button, results are displayed in a repeater control. The DeviceID for each device is clickable and when clicked, it takes the user to another page that has all the details about that certain device. I want to be able to display the image for that certain device on that page, as well as all the other information. I have the image being saved as Image type in my SQL database. But I can't figure out how to get it out of my database and display it on the page. I've tried a few different approaches including displaying it in a grid control, which didn't work. I also tried using ASHX files but couldn't quite figure that one out either. I am using C# and ASP.NET. Any help would be greatly appreciated. If any code is needed, please let me know and I will be glad to post it. Thanks!

2 Answers 2

2

First hit on Google:

Retrieve Images from a SQL database for display in an Asp.Net Datagrid

Sign up to request clarification or add additional context in comments.

Comments

2

Was able to solve this kind of issue using a Handler (ASHX). there are a lot of samples online. try this .. http://www.aspdotnetcodes.com/Insert_Images_Database.aspx

1 Comment

I've tried this so many different times but I could never get it to work correctly. I think it had something to do with the ImageUrl. I was able to statically set an image and have it displayed, but for some annoying reason, I couldn't get the ASHX to work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.