PDA

View Full Version : gridview, doesn't show me the image instead of showing me a text "System.Byte[]"



saeed31641
جمعه 25 شهریور 1390, 10:11 صبح
I try to use gridview with objectdatasource to obtain the images from the sql database. Within the database, a datafield is declare as "varbinary" datatype.

Now in my gridview, it doesn't show me the image instead of showing me a text "System.Byte[]"

May I know how to solve it.

dorparasti
جمعه 25 شهریور 1390, 13:30 عصر
i did it by using handlers . my handler got an id and retrives bytes from database and send it as an image .
then I set my <img> src attribute to that handler
somthing like <img src='myhandler.ashx?ImageID=5' />