[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

retrieve sql image data type into asp.net display

Posted on 2011-02-25
4
Medium Priority
?
939 Views
Last Modified: 2012-05-11
I need to retrieve a image field from a sql database into some to display it in my asp.net app..

any suggestions on how to do this?
0
Comment
Question by:vbnetcoder
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 13

Expert Comment

by:Rahul Agarwal
ID: 34985545

http://www.codeproject.com/KB/database/ImageSaveInDataBase.aspx
http://social.msdn.microsoft.com/Forums/en/adodotnetdataproviders/thread/deb976d4-0678-4411-8e76-be2a7f5f280b

Example:
// imageData retrieve from SQL Server
                byte[] imageData = GetBytesFromUrl("http://student.kfupm.edu.sa/s200354630/Multi/images/o-png8.png");
                MemoryStream stream = new MemoryStream(imageData);

                System.Drawing.Image img = System.Drawing.Image.FromStream(stream);

                Response.Clear();
                Response.ContentType = "image/jpg";
                img.Save(Response.OutputStream, ImageFormat.Jpeg);
                img.Dispose();
0
 

Author Comment

by:vbnetcoder
ID: 34985632
I used the code in the first link and it did not like this line:

 pictureBox1.Image = Image.FromFile(strfn)

it said that .fromfile was not a member of system.web.ui.webcontrols.image
0
 
LVL 2

Accepted Solution

by:
aspxkid earned 2000 total points
ID: 34987503
0
 

Author Closing Comment

by:vbnetcoder
ID: 34987622
ty
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

649 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