Saturday 16 March 2013

DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'ID'.


HttpException was unhandled by user code.
DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'ID'.



Server Error in '/LibraryCart' Application.

DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'ID'.

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: DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'ID'.

Source Error:


Line 16:             <ItemTemplate>
Line 17: ProductID:
Line 18: <asp:Label ID="ProductIDLabel" runat="server" Text='<%# Eval("ID") %>' />
Line 19: <br />
Line 20: <%-- TypeOfImage:

Source File: h:\LibraryCart\Default.aspx    Line: 18

Stack Trace:


[HttpException (0x80004005): DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'ID'.]
System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +197
System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts) +79
System.Web.UI.DataBinder.Eval(Object container, String expression) +107
System.Web.UI.TemplateControl.Eval(String expression) +120
ASP.default_aspx.__DataBinding__control5(Object sender, EventArgs e) in h:\LibraryCart\Default.aspx:18
System.Web.UI.Control.OnDataBinding(EventArgs e) +99
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +206
System.Web.UI.Control.DataBind() +12
System.Web.UI.Control.DataBindChildren() +204
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +216
System.Web.UI.Control.DataBind() +12
System.Web.UI.WebControls.DataList.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +131
System.Web.UI.WebControls.DataList.CreateControlHierarchy(Boolean useDataSource) +613
System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) +56
System.Web.UI.WebControls.BaseDataList.DataBind() +52
System.Web.UI.WebControls.BaseDataList.EnsureDataBound() +76
System.Web.UI.WebControls.BaseDataList.CreateChildControls() +63
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +50
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433 


After Setting The Correct ID Name As In The Database It Works Without error...As This Exception Occurs

No comments:

Post a Comment

Note: only a member of this blog may post a comment.