如何在datagridview中显示图像? [英] How to display image in datagridview ?

查看:111
本文介绍了如何在datagridview中显示图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的照片在数据库中。 Sql值类型是图像。我想在gridview中显示我的图片。但我不能。我怎样才能做到这一点 ? Datagridview的数据源是正确的。但是我看不到图片。

My pictures are in the database. Sql value type is image. I want to display my pictures in the gridview. But i can''t. How can i do this ? Datagridview''s datasource is correct. But i can''t see pictures.

推荐答案

你总是可以派生出类 System.Windows.Forms.DataGridViewCell DataGridView 的单元格中显示任何内容。但是为了显示图像,这种细胞类已经存在。请参阅:

http://msdn.microsoft .com / zh-cn / library / system.windows.forms.datagridviewimagecell.aspx [ ^ ]。



-SA
You can always derive the class System.Windows.Forms.DataGridViewCell to show anything in the cell of a DataGridView. But for showing images, such cell class already exists. Please see:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewimagecell.aspx[^].

—SA


试试这个

http://www.aspsnippets.com/articles/ display-images-from-sql-server-database-in-asp.net-gridview-control.aspx [ ^ ]



全部最好



问候,

Gopinath
Try this
http://www.aspsnippets.com/articles/display-images-from-sql-server-database-in-asp.net-gridview-control.aspx[^]

All the Best

Regards,
Gopinath


这篇关于如何在datagridview中显示图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆