不显示图像gridview [英] dont show image gridview

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

问题描述

if (FileUpload1.HasFile)
 {
     using (BinaryReader reader = new BinaryReader                  (FileUpload1.PostedFile.InputStream))
     {
     (FileUpload1.PostedFile.ContentLength);
         imagedata = new byte
                  [FileUpload1.PostedFile.ContentLength];
         HttpPostedFile uploadedImage = FileUpload1.PostedFile;
         uploadedImage.InputStream.Read
            (imagedata, 0, (int)FileUpload1.PostedFile.ContentLength);


     }



然后保存到db .无法显示. gridview显示disply gridview {system Byte[]}
不要将图像显示到gridview.
提交到db的图像是varbinary(max)



then save to db . can''t to display. gridview dispaly gridview {system Byte[]}
dont show image to gridview.
image filed to db is varbinary(max)

推荐答案

google搜索: ^ ]
google search: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/cb58a3a5-10f8-452b-aac4-744ce2de235e/[^]


要通过网格视图显示图像,您需要为此编写处理程序文件.

http://www.aspnettutorials.com/tutorials/database/saving-retrieving-image- cs.aspx [ ^ ]


我希望此链接能满足您的需求.
享受....
For displaying images through grid view, you need to write a handler file for that.

http://www.aspnettutorials.com/tutorials/database/saving-retrieving-image-cs.aspx[^]


I hope this link will do for what are you looking for.
Enjoy.....


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

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