Asp.Net 2
I am trying to display Image from Northwind Database.
I ran a queary "SELECT CategoryID, CategoryName, Description, Picture FROM
Categories" but the Dataview displayes all the fields except Picture.
so i add a Imagefield to display images..but now i get cross icon..
below is the code. correct me where i am wrong....
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataKeyNames="CategoryID"
DataMember="DefaultView" DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="CategoryID"
HeaderText="CategoryID" InsertVisible="False"
ReadOnly="True" SortExpression="CategoryID" />
<asp:BoundField DataField="CategoryName"
HeaderText="CategoryName" SortExpression="CategoryName" />
<asp:BoundField DataField="Description"
HeaderText="Description" SortExpression="Description" />
<asp:ImageField DataAlternateTextField="Picture"
DataImageUrlField="Picture" DataImageUrlFormatString="~\Images\{0}.jpg"
HeaderImageUrl="Picture" HeaderText="Picture"
ReadOnly="True">
</asp:ImageField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT CategoryID, CategoryName, Description,
Picture FROM Categories">
</asp:SqlDataSource>