Reputation: 69
I have a database which contains many columns, one of the columns is an image column , this contains the image of a particular person in raw format. I want to put this image on datagrid view in C# . I am able to show all other data except the image.
Upvotes: 0
Views: 223
Reputation: 62488
You can use handler to display image in gridview , your html markup look like inside
Gridview ItemTemplate set image control src as src=~/ShowImage.ashx?id=" + id
where ShowImage.ashx is your handler which return MemoryStream((byte[])img);
Here is a similar article how to get binary data and display as image
In your case your querystring is characterID
so your image src would be src=~/ShowImage.ashx?id=" + characterID
Upvotes: 1
Reputation: 69
OKay got it . you do the normal updating of datagrid view with ur query and then make sure u set your datagrid view columns and rows to autosize so that u can see ur images
Upvotes: 0