Newbie image question.

  • Thread starter Thread starter Jensen bredal
  • Start date Start date
J

Jensen bredal

How do i display an image stored in a database in an
asp.net web form?

I assume the image need not to be scaled.
 
How do i display an image stored in a database in an
asp.net web form?

I assume the image need not to be scaled.

For some reason, I couldn't find a simpler example than this:

http://www.codeproject.com/aspnet/image_asp.asp

Check out the latter part of the article, view.aspx is what you're looking
for. The only thing is the author created a custom class for DB
interaction, don't let it confuse you in the code. The DB access code is
above the section I'm referring to.
 
For some reason, I couldn't find a simpler example than this:

http://www.codeproject.com/aspnet/image_asp.asp

Check out the latter part of the article, view.aspx is what you're
looking for. The only thing is the author created a custom class for DB
interaction, don't let it confuse you in the code. The DB access code
is above the section I'm referring to.

dang, sorry for the extra reply...my newsreader broke the thread and i
didn't notice...

enjoy...
 
Well that example was great too. But i have noticed two things compare with
previous link i got.

The example here does not tell you how to display the image from a datagrid
as an example.


And other thing that is common to both example is that the
response.ContenType is not set from a value in database.
Im my code i also do store Response.ContentType and
that should lead to the following:

Response.ContentType = dr[ImageContentType].ToString();
where dr is the datarow containing my image info.

Many thanks
 
Back
Top