DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'ProductImage'.
Line 76: <tr> Line 77: <td class="auto-style8"> Line 78: <asp:Image ID="Image1" runat="server" Height="160px" ImageUrl='<%# Eval("ProductImage") %>' Width="167px" /> Line 79: </td> Line 80: </tr>
<asp:DataList ID="DataList1" runat="server" CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="#333333" RepeatColumns="4" RepeatDirection="Horizontal" Height="353px" Width="689px" OnSelectedIndexChanged="DataList1_SelectedIndexChanged" OnItemCommand="DataList1_ItemCommand" CssClass="auto-style12" HorizontalAlign="Justify"> <AlternatingItemStyle BackColor="White" /> <%-- <FooterStyle BackColor="##507CD1" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />--%> <ItemStyle BackColor="#EFF3FB" /> <ItemTemplate> <table border="1" class="auto-style6"> <tr> <td class="auto-style4"> PRODUCT ID : <asp:Label ID="Label2" runat="server" Text='<%# Eval("ProductId") %>'></asp:Label> </td> </tr> <tr> <td class="auto-style10"> <asp:Label ID="Label3" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label> </td> </tr> <tr> <td class="auto-style8"> <asp:Image ID="Image1" runat="server" Height="160px" ImageUrl='<%# Eval("ProductImage") %>' Width="167px" /> </td> </tr> <tr> <td class="auto-style11">OMR <asp:Label ID="Label4" runat="server" Text='<%# Eval("ProductPrice") %>'></asp:Label> </td> </tr> <tr> <td class="auto-style10"> <asp:ImageButton ID="ImageButton1" runat="server" Height="48px" ImageUrl="~/Medicinepics/Addtocart.jpg" Width="223px" CommandName="addtocart" CommandArgument='<%#Eval("ProductId") %>' /> </td> </tr> </table> <br /> <br /> </ItemTemplate> <SelectedItemStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /> </asp:DataList> </div> <asp:SqlDataSource ID="SqlDataSource1" runat="server" OnSelecting="SqlDataSource1_Selecting" ConnectionString="<%$ ConnectionStrings:SMZConnection %>" SelectCommand="SELECT * FROM [Product Detail]"></asp:SqlDataSource>
CREATE TABLE [dbo].[Product Detail] ( [Id] INT IDENTITY (1, 1) NOT NULL, [ProductId] INT NULL, [ProductName] VARCHAR (150) NULL, [ProductPrice] VARCHAR (50) NULL, [ProductImage] VARCHAR (150) NULL );
Medicinepics/advil.jpg
ProductImage
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)