Thursday, March 22, 2012

Newbie image question.

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.On Sat, 12 Jun 2004 03:38:37 +0200, Jensen bredal
<jensen.bredal@.mimosa.com> wrote:

> 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.

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
On Sat, 12 Jun 2004 20:58:36 -0500, Craig Deelsnyder
<cdeelsny@.no_spam_4_meyahoo.com> wrote:

> On Sat, 12 Jun 2004 03:38:37 +0200, Jensen bredal
> <jensen.bredal@.mimosa.com> wrote:
>> 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.

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

enjoy...

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
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

"Craig Deelsnyder" <cdeelsny@.no_spam_4_meyahoo.com> wrote in message
news:opr9if21dg75dg5d@.tux...
> On Sat, 12 Jun 2004 20:58:36 -0500, Craig Deelsnyder
> <cdeelsny@.no_spam_4_meyahoo.com> wrote:
> > On Sat, 12 Jun 2004 03:38:37 +0200, Jensen bredal
> > <jensen.bredal@.mimosa.com> wrote:
> >> 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.
> dang, sorry for the extra reply...my newsreader broke the thread and i
> didn't notice...
> enjoy...
> --
> Craig Deelsnyder
> Microsoft MVP - ASP/ASP.NET

0 comments:

Post a Comment