Retrieve image from SQL Server

Posted on 2011-02-16
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...
Question by:PagodNaUtak
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

Accepted Solution

ong-hh earned 500 total points
ID: 34913187

// imageData retrieve from SQL Server
                byte[] imageData = GetBytesFromUrl("");
                MemoryStream stream = new MemoryStream(imageData);

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

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

Author Comment

ID: 34913455
is there away to use add rotator?

Featured Post

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

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

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…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL ( and MongoDB (…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

696 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