Blob

  • Thread starter Thread starter ichor
  • Start date Start date
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
 
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
 
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
 
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.
 
Back
Top