如何在数据库中显示gridview中的图像 [英] How to show image in gridview from database

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

问题描述

大家好



我的代码是



hi all

my code is

<asp:TemplateField HeaderText="Image">
                <ItemTemplate>
                 <asp:Image ID="imgproduct" ImageUrl='<%#Eval("image")%>'  runat="server" Width="30" Height="30" />
                </ItemTemplate>
                </asp:TemplateField>







cs code






cs code

string Qry = "select id,product,description,image from ProductAdd ";
            grdaddproduct.DataSource = adpro.GetData(Qry);
            grdaddproduct.DataBind();







这里的adpo.getdata是方法



感谢




Here adpo.getdata is method

Thanks

推荐答案

图像路径中的问题。检查路径是否正确。你的代码是正确的。
problem in image path. check whether path is correct. your code is correct.


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

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