Groups | Blog | Home
all groups > asp.net webcontrols > april 2006 >

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


Auto
4/27/2006 12:00:00 AM
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.

vMike
5/2/2006 3:21:43 AM

[quoted text, click to view]
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

AddThis Social Bookmark Button