Solved

Display and image from SQL Server

Posted on 2008-10-23
5
662 Views
Last Modified: 2013-12-17
I am able to upload an image to a SQL Server Database using C#, However, I am unable to read the image from the database and display it in an img element.  I am using ASP.NET 2.0.

Thank you for you help.  
0
Comment
Question by:shanemay
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:mkosbie
ID: 22791815
You need to create a page to read the image data from the DB, then use that page as the source for your image.  http://www.codeproject.com/KB/asp/Display_Images_from_Data.aspx
0
 

Author Comment

by:shanemay
ID: 22791842
Is the same true for ASP.NET, the link has some good information, however, it references ASP only.

Thank you
0
 
LVL 8

Accepted Solution

by:
mkosbie earned 500 total points
ID: 22791851
The procedure is the same in .NET, just translate the code from ASP/VBScript to .NET/C#.  Here's a page with C# code samples: http://www.aspfree.com/c/a/ASP.NET/Retrieving-Images-from-a-Database--C---Part-II/
0
 

Author Closing Comment

by:shanemay
ID: 31509480
Thank you for your help.  The solution makes so much sense now.  I really appreciate your help.  
0
 
LVL 8

Expert Comment

by:mkosbie
ID: 22791897
Glad to help.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

766 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