Blob

I

ichor

hi
i have a blob field in my database and am able to display it on my asp.net
page
i would like to know how can i position the Blob on the page or can i use an
image object?


byte[] Picture;
Picture = (byte[])dr["logo"];
Response.Buffer=true;
Response.ContentType = "Image/JPEG"; //after i set this i cant even get a
response.write to work on mypage.
Response.BinaryWrite(Picture);
is there any way i can put this picture in an imagebutton?


thanx
 
W

Wim Hollebrandse

You can't mix content types. Once you've set the content type of your page to image/jpeg, you can't use Response.Write and expect normal HTML content.

Instead - server the image from an external linked ASP.NET page and link it in an <img> tag.

E.g.

<img src="mydynamicimage.aspx?id=4" />

Hope that helps.

Cheers,
Wim Hollebrandse
http://www.wimdows.net
http://www.wimdows.com
 
I

ichor

thanx works well...
i just wanted to know what are the advantages of storing the images in a
blob as opposed to storing the filepath in the table and retrieving the
image from there.
thanx for your help
 
K

Kevin Spencer

There are only DISadvantages to storing images in a BLOB field at this time,
due to the processing overhead involved in storing and fetching binary data
from a database rather than the file system. Perhaps with Longhorn, this
will change.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top