开发者

How to convert byte array to image and display in datagrid?

开发者 https://www.devze.com 2023-02-14 12:31 出处:网络
I have made a sql database using sql server. This database include images. When I display this database in a datagrid, byte[]array displays in the image column. How do I convert from a byte array back

I have made a sql database using sql server. This database include images. When I display this database in a datagrid, byte[]array displays in the image column. How do I convert from a byte array back to an image and then d开发者_运维知识库isplay that image in the datagrid? Any help or tutorials are appreciated. thanks


Try

 MemoryStream ms = new MemoryStream(imageBytes);
 Image image= Image.FromStream(ms);


take a look a this tutorial:

http://www.beansoftware.com/ASP.NET-Tutorials/Images-Database.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号