如何在Gridview中显示图像。我加入了两张桌子。 [英] How To Show Image In Gridview .? I Am Join Two Table.
本文介绍了如何在Gridview中显示图像。我加入了两张桌子。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的gridview: -
my gridview:-
<asp:Content ID="Content1" runat="server"
contentplaceholderid="ContentPlaceHolder1">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px"
CellPadding="4">
<FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
<PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
<RowStyle BackColor="White" ForeColor="#330099" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
<SortedAscendingCellStyle BackColor="#FEFCEB" />
<SortedAscendingHeaderStyle BackColor="#AF0101" />
<SortedDescendingCellStyle BackColor="#F6F0C0" />
<SortedDescendingHeaderStyle BackColor="#7E0000" />
</asp:GridView>
</asp:Content>
这是我的代码: -
this is my code:-
protected void Page_Load(object sender, EventArgs e)
{
BindGrid();
}
private void BindGrid()
{
SqlConnection con = new SqlConnection(bank);
con.Open();
SqlCommand com = new SqlCommand("select tbl_membership.Imagename as Image,tbl_associcatemember.Applicationo as ApplNo,tbl_associcatemember.memberidno as MemberId,tbl_associcatemember.A_firstname+' '+tbl_associcatemember.A_middlename+' '+tbl_membership.A_lastname as FullName,tbl_associcatemember.occuption,tbl_associcatemember.education,tbl_associcatemember.dob,tbl_associcatemember.contact,tbl_associcatemember.address+','+tbl_associcatemember.city+','+tbl_associcatemember.state as Address,tbl_associcatemember.pin,tbl_associcatemember.banckac as BankAcNo,tbl_associcatemember.ifcs as IFCS,tbl_associcatemember.branchname as Branch,tbl_associcatemember.Associate_member_code as AssociateId,tbl_associcatemember.designation,tbl_associcatemember.Branch_name_code as BranchCode,tbl_associcatemember.singnatory from tbl_associcatemember inner join tbl_membership on tbl_membership.memberidno=tbl_associcatemember.memberidno", con);
SqlDataReader dr = com.ExecuteReader();
GridView1.DataSource = dr;
GridView1.DataBind();
con.Close();
}
请帮帮我?
谢谢
please Help me?
thanks
推荐答案
试试这个解决方案
如果要从数据库中提取图像 [ ^ ]
Try this solution
If you are fetching images from database[^]
这篇关于如何在Gridview中显示图像。我加入了两张桌子。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文