Print Page | Close Window

Retrieving images from SQL Server

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=17010
Printed Date: 29 March 2026 at 6:49pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Retrieving images from SQL Server
Posted By: Leeb65
Subject: Retrieving images from SQL Server
Date Posted: 24 October 2005 at 10:26am
Hi all,
 
I am trying to display images that are stored in SQL Server 2000 in an image datatype field.
 
I need to display the images on a web form.
 
Does anyone know how?
 
Thanks
 
 


-------------
Lee

http://www.rheinsitemedia.de">



Replies:
Posted By: michael
Date Posted: 24 October 2005 at 5:27pm

It depends how the image was stored, you can convert the stream to a Byte Array then  convert the Byte Array to an image doing a Response.BinaryWrite to a seperate aspx page (The Browser should automatically recognize the MIME Type.)

So esentially you'd set the image to be something like <img src="myimagepage.aspx?image=someID">


-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: michael
Date Posted: 24 October 2005 at 5:32pm
One easy to understand Code example is http://www.aspfree.com/c/a/ASP.NET/Uploading-Images-to-a-Database--C---Part-I/ - here

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net