Solved

Retrieve image from SQL Server

Posted on 2011-02-16
4
855 Views
Last Modified: 2013-12-17
Retrieve image [byte] from SQL Server then store it to ad rotator or an image control?
any help or suggestion is greatly appreciated...

I am using ASP.NET... not windows form...
0
Comment
Question by:PagodNaUtak
  • 2
4 Comments
 
LVL 13

Expert Comment

by:agarwalrahul
ID: 34913179
0
 
LVL 4

Accepted Solution

by:
ong-hh earned 500 total points
ID: 34913187

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
 
LVL 8

Author Comment

by:PagodNaUtak
ID: 34913455
is there away to use add rotator?
0
 
LVL 4

Expert Comment

by:ong-hh
ID: 34913751
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

707 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

14 Experts available now in Live!

Get 1:1 Help Now