DataBinder.Eval: 'System.Data.Common.DbDataRecord' does not contain a property with the name Sizes.

Posted on 2005-04-26
Last Modified: 2012-06-21
I am getting the following error. I've been looking at it too long to see what i've missed. Please help.

DataBinder.Eval: 'System.Data.Common.DbDataRecord' does not contain a property with the name Sizes.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: DataBinder.Eval: 'System.Data.Common.DbDataRecord' does not contain a property with the name Sizes.

Source Error:

Line 62:                                                                                           <asp:TemplateColumn HeaderText="Size">
Line 63:                                                                                                 <ItemTemplate>
Line 64:                                                                                                       <asp:Label id="Size" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Sizes") %>' width="40px" />
Line 65:                                                                                                 </ItemTemplate>
Line 66:                                                                                           </asp:TemplateColumn>

Source File: c:\inetpub\wwwroot\\ShoppingCart.aspx    Line: 64

Stack Trace:

[HttpException (0x80004005): DataBinder.Eval: 'System.Data.Common.DbDataRecord' does not contain a property with the name Sizes.]
   System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +147
   System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts) +71
   System.Web.UI.DataBinder.Eval(Object container, String expression) +82
   ASP.ShoppingCart_aspx.__DataBind__control15(Object sender, EventArgs e) in c:\inetpub\wwwroot\\ShoppingCart.aspx:64
   System.Web.UI.Control.OnDataBinding(EventArgs e) +66
   System.Web.UI.Control.DataBind() +26
   System.Web.UI.Control.DataBind() +86
   System.Web.UI.Control.DataBind() +86
   System.Web.UI.WebControls.DataGrid.CreateItem(Int32 itemIndex, Int32 dataSourceIndex, ListItemType itemType, Boolean dataBind, Object dataItem, DataGridColumn[] columns, TableRowCollection rows, PagedDataSource pagedDataSource) +169
   System.Web.UI.WebControls.DataGrid.CreateControlHierarchy(Boolean useDataSource) +1403
   System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) +49
   System.Web.UI.WebControls.BaseDataList.DataBind() +23
   ASPNET.StarterKit.Commerce.ShoppingCart.PopulateShoppingCartList() in c:\inetpub\wwwroot\company\shoppingcart.aspx.cs:118
   ASPNET.StarterKit.Commerce.ShoppingCart.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\company\shoppingcart.aspx.cs:44
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Page.ProcessRequestMain() +750

Here is some of the code. Let me know if you need more.

                                                                                          <asp:TemplateColumn HeaderText="Product&#160;ID">
                                                                                                      <asp:Label id="ProductID" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ProductID") %>' />
                                                                                          <asp:BoundColumn DataField="ModelName" HeaderText="Product Name"></asp:BoundColumn>
                                                                                          <asp:BoundColumn DataField="ModelNumber" HeaderText="Model"></asp:BoundColumn>
                                                                                          <asp:TemplateColumn HeaderText="Size">
                                                                                                      <asp:Label id="Size" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Sizes") %>' width="40px" />
                                                                                          <asp:TemplateColumn HeaderText="Quantity">
                                                                                                      <asp:TextBox id="Quantity" runat="server" Columns="4" MaxLength="3" Text='<%# DataBinder.Eval(Container.DataItem, "Quantity") %>' width="40px" />
                                                                                          <asp:BoundColumn DataField="UnitCost" HeaderText="Price" DataFormatString="{0:c}"></asp:BoundColumn>
                                                                                          <asp:BoundColumn DataField="ExtendedAmount" HeaderText="Subtotal" DataFormatString="{0:c}"></asp:BoundColumn>
                                                                                          <asp:TemplateColumn HeaderText="Remove">
                                                                                                            <asp:CheckBox id="Remove" runat="server" />
Question by:dbruyere
    LVL 12

    Expert Comment

    Does the table that you binds to the datagrid has a column Sizes?
    LVL 1

    Author Comment

    Yes. Sorry, it was a stored procedure problem. Finally realized it after 3 hours of being braindead.

    Accepted Solution

    The question has been PAQ'd and the 500 points have been refunded.
    Community Support Moderator

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    This video discusses moving either the default database or any database to a new volume.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now