Click here to Skip to main content
15,907,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a List View With Images...I need to display the name of the image...below the image the should be display...using C# .net windows application

1 solution

I don't know whether you save image URLs in your database or a binary data. If you save image's addresses in your db, then, you can you this piece of code to show images in the ListView. You can show every data after or before images:
<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" 
                <asp:Image runat="server" ID="img1" ImageUrl='<%# Eval("Text") %>' />
                <br />
                <asp:Label Text='<%# Eval("StartYear") %>' runat="server" ID="txt"></asp:Label>

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:YourConnectionName %>"
           SelectCommand="SELECT top 10 [Text], [StartYear] FROM [tbl_FishMessage]">

I hope it helps,
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900