Home All Groups Group Topic Archive Search About

How to Display an image, from a DB, into the Gridview (ASP.NET 2.0)

Author
27 Apr 2006 7:13 AM
Auto
Hello,

I would like to know how do display an image into a Gridview (ASP.NET 2.0)
taken directly from a DataBase, NOT using an URL, like described in this
article:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/GridViewEx06.asp

I have NO URL, i have the binary image inside the DB, like the field "Photo"
in the table "Employees" of the "NWIND.MDB" DataBase.
Any hints?

Thanks,
Auto.

Author
2 May 2006 7:21 AM
vMike
Show quote Hide quote
"Auto" <a***@auto.it> wrote in message
news:u69qQocaGHA.3524@TK2MSFTNGP04.phx.gbl...
> Hello,
>
> I would like to know how do display an image into a Gridview (ASP.NET 2.0)
> taken directly from a DataBase, NOT using an URL, like described in this
> article:
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/GridViewEx06.asp
>
> I have NO URL, i have the binary image inside the DB, like the field
> "Photo"
> in the table "Employees" of the "NWIND.MDB" DataBase.
> Any hints?
>
> Thanks,
> Auto.
>
>
You would set the ImageUrl to another aspx file like
getpicture.aspx?picture=1234 and in that page you would use
system.drawing.image to get the stream from the database and then save it to
the response.outputstream. There are some examples floating around. There
are a lot of things you can do inside that process also like resize, add
text, crop etc.
Hope this helps.
Mike