实现功能:gridview中添加图片显示
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ConnectionStrings:ConnectionString%>"
SelectCommand=" select * from FriendsLink order by ID desc" DeleteCommand="delete from FriendsLink where ID=@ID" UpdateCommand="update FriendsLink set LinkName=@LinkName,LinkAdress=@LinkAdress,LinkPicPath=@LinkPicPath where ID=@ID">
</asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" DataSourceID="SqlDataSource1" ForeColor="#333333"
BorderWidth="1px" RowStyle-HorizontalAlign="Center" CellPadding="3" GridLines="Vertical"
Width="760px" DataKeyNames="ID" PageSize="15">
<Columns>
<asp:HyperLinkField DataNavigateUrlFields="ID" DataNavigateUrlFormatString="./showLink.aspx?ID={0}"
DataTextField="LinkName" HeaderText="详细信息" />
<asp:ImageField DataImageUrlField="LinkPicPath" DataImageUrlFormatString="{0}" HeaderText="Logo">
</asp:ImageField>
<asp:BoundField DataField="LinkName" HeaderText="链接名称" SortExpression="LinkName" />
<asp:BoundField DataField="LinkAdress" HeaderText="链接地址" SortExpression="LinkAdress" />
<asp:CommandField ShowEditButton="true" HeaderText="编辑" />
<asp:CommandField ShowDeleteButton="True" HeaderText="删除" />
</Columns>
<RowStyle BackColor="#EFF3FB" />
<EditRowStyle BackColor="#2461BF" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
SelectCommand=" select * from FriendsLink order by ID desc" DeleteCommand="delete from FriendsLink where ID=@ID" UpdateCommand="update FriendsLink set LinkName=@LinkName,LinkAdress=@LinkAdress,LinkPicPath=@LinkPicPath where ID=@ID">
</asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" DataSourceID="SqlDataSource1" ForeColor="#333333"
BorderWidth="1px" RowStyle-HorizontalAlign="Center" CellPadding="3" GridLines="Vertical"
Width="760px" DataKeyNames="ID" PageSize="15">
<Columns>
<asp:HyperLinkField DataNavigateUrlFields="ID" DataNavigateUrlFormatString="./showLink.aspx?ID={0}"
DataTextField="LinkName" HeaderText="详细信息" />
<asp:ImageField DataImageUrlField="LinkPicPath" DataImageUrlFormatString="{0}" HeaderText="Logo">
</asp:ImageField>
<asp:BoundField DataField="LinkName" HeaderText="链接名称" SortExpression="LinkName" />
<asp:BoundField DataField="LinkAdress" HeaderText="链接地址" SortExpression="LinkAdress" />
<asp:CommandField ShowEditButton="true" HeaderText="编辑" />
<asp:CommandField ShowDeleteButton="True" HeaderText="删除" />
</Columns>
<RowStyle BackColor="#EFF3FB" />
<EditRowStyle BackColor="#2461BF" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>