0

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.

2 Answers 2

1

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

https://codepedia.info/convert-binary-data-to-image-save-and-retrieve-image-from-binary-data-asp-net-c/

In your case your querystring is characterID

so your image src would be src=~/ShowImage.ashx?id=" + characterID

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.