Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Chris Knowles 141 posts 222 karma points
    Sep 13, 2012 @ 12:22
    Chris Knowles
    0

    Sequence contains more than one matching element

    Hi,

    We are getting this error when going into a section in uCommerce, the other sections seem to work fine.

    Server Error in '/' Application.

    Sequence contains more than one matching element

    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.InvalidOperationException: Sequence contains more than one matching element

    Source Error: 

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace: 

    [InvalidOperationException: Sequence contains more than one matching element]
       System.Linq.Enumerable.SingleOrDefault(IEnumerable`1 source, Func`2 predicate) +2716738
       UCommerce.EntitiesV2.Product.GetPrice(PriceGroup priceGroup) +81
       UCommerce.Catalog.PricingService.GetProductPrice(Product product, PriceGroup priceGroup) +38
       UCommerce.Catalog.PricingService.GetProductPrice(Product product, ProductCatalog catalog) +30
       UCommerceWeb.Umbraco.UCommerce.Catalog.<>c__DisplayClass1.<DataBind>b__0(Product product) +286
       System.Linq.WhereSelectListIterator`2.MoveNext() +110
       System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +507
       System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +61
       System.Web.UI.WebControls.Repeater.DataBind() +76
       UCommerceWeb.Umbraco.UCommerce.Catalog.EditCategoryProducts.DataBind() +916
       System.Web.UI.Control.DataBindChildren() +201
       System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
       System.Web.UI.Control.DataBind() +15
       System.Web.UI.Control.DataBindChildren() +201
       System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
       System.Web.UI.Control.DataBind() +15
       UCommerce.Presentation.Web.Umbraco.TabViewBuilder.BuildTabView(TabView tabView, IView view, Boolean databindTabView, ImageClickEventHandler saveMethod, ImageClickEventHandler deleteMethod) +556
       UCommerceWeb.Umbraco.UCommerce.Catalog.EditCategory.InitializeTabView(TabView tabView) +78
       UCommerceWeb.Umbraco.UCommerce.MasterPages.UmbracoTabView.Page_Load(Object sender, EventArgs e) +64
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
       System.Web.UI.Control.OnLoad(EventArgs e) +91
       System.Web.UI.Control.LoadRecursive() +74
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
    


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

    From umbracoLog table:

    At /umbraco/ucommerce/catalog/editcategory.aspx?id=115 (Referred by: http://www.website.com/umbraco/umbraco.aspx): System.InvalidOperationException: Sequence contains more than one matching element
       at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
       at UCommerce.EntitiesV2.Product.GetPrice(PriceGroup priceGroup)
       at UCommerce.Catalog.PricingService.GetProductPrice(Product product, PriceGroup priceGroup)
       at UCommerce.Catalog.PricingService.GetProductPrice(Product product, ProductCatalog catalog)
       at UCommerceWeb.Umbraco.UCommerce.Catalog.EditCategoryProducts.<>c__DisplayClass1.<DataBind>b__0(Product product)
       at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
       at System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource)
       at System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e)
       at System.Web.UI.WebControls.Repeater.DataBind()
       at UCommerceWeb.Umbraco.UCommerce.Catalog.EditCategoryProducts.DataBind()
       at System.Web.UI.Control.DataBindChildren()
       at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
       at System.Web.UI.Control.DataBind()
       at System.Web.UI.Control.DataBindChildren()
       at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
       at System.Web.UI.Control.DataBind()
       at UCommerce.Presentation.Web.Umbraco.TabViewBuilder.BuildTabView(TabView tabView, IView view, Boolean databindTabView, ImageClickEventHandler saveMethod, ImageClickEventHandler deleteMethod)
       at UCommerceWeb.Umbraco.UCommerce.Catalog.EditCategory.InitializeTabView(TabView tabView)
       at UCommerceWeb.Umbraco.UCommerce.MasterPages.UmbracoTabView.Page_Load(Object sender, EventArgs e)
       at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
       at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
       at System.Web.UI.Control.OnLoad(EventArgs e)
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    Any ideas?

    Thanks

    Chris

  • Chris Knowles 141 posts 222 karma points
    Sep 13, 2012 @ 17:10
    Chris Knowles
    1

    Turns out the customer had *somehow* managed to get two entries in the PriceGroupPrice table and this duplication was causing the error.

    Thanks Soren for your help.

    Chris

  • Søren Spelling Lund 1797 posts 2786 karma points
    Sep 17, 2012 @ 11:23
    Søren Spelling Lund
    0

    Thanks, Chris, for following up here. Much appreciated!

Please Sign in or register to post replies

Write your reply to:

Draft