BV Commerce Forum
»
BV Commerce Support
»
General Support
»
Exception Details: System.ArgumentException: An entry with the same key already exists.
Rank: Member
Joined: 6/6/2005(UTC) Posts: 483
|
We upgraded our site to SP2.
I'm getting the following error under the option "Orders" on all pre SP2 orders when I try to view the order, but not on any of the post SP2 orders. This includes any orders transfered over from BV4. I seem to be able to get at all the Data in the database using Access both before and after SP2.
Any ideas what we did wrong or how to fix it?
Server Error in '/' Application. An entry with the same key already exists. 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.ArgumentException: An entry with the same key already exists.
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
<configuration> <system.web> <compilation debug="true"/> </system.web> </configuration>
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
Stack Trace:
[ArgumentException: An entry with the same key already exists.] System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) +48 System.Collections.Generic.SortedList`2.Add(TKey key, TValue value) +39 BVSoftware.Bvc5.Core.Orders.LineItem.GetCustomerVisibleInputsAndModifiers() +120 ViewUtilities.GetInputsAndModifiersForLineItemDescription(Page p, GridView gv, Location where) +447 ViewUtilities.GetInputsAndModifiersForAdminLineItemDescription(Page p, GridView gv) +6 BVAdmin_Orders_ViewOrder.ItemsGridView_DataBound(Object sender, EventArgs e) +41 System.Web.UI.WebControls.BaseDataBoundControl.OnDataBound(EventArgs e) +86 System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +137 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +29 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70 System.Web.UI.WebControls.GridView.DataBind() +4 BVAdmin_Orders_ViewOrder.PopulateFromOrder(Order o) +964 BVAdmin_Orders_ViewOrder.LoadOrder() +78 BVAdmin_Orders_ViewOrder.Page_Load1(Object sender, EventArgs e) +161 System.EventHandler.Invoke(Object sender, EventArgs e) +0 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
Bob Noble
|
|
|
|
Rank: Member
Joined: 3/1/2006(UTC) Posts: 1,142
|
Connect to the database and run this script after you make a backup...
WITH Items AS ( SELECT bvin, LineItemBvin, [Order], 1 AS [Table] FROM bvc_LineItemModifier UNION SELECT bvin, LineItemBvin, [Order], 2 AS [Table] FROM bvc_LineItemInput) SELECT ROW_NUMBER() OVER (PARTITION BY LineItemBvin ORDER BY [LineItemBvin], [Order]) As RowNum, bvin, LineItemBvin, [Order], [Table] INTO #ALLROWS FROM Items ORDER BY LineItemBvin, RowNum
SELECT * INTO #MODIFIERROWS FROM #ALLROWS WHERE [Table] = 1 SELECT * INTO #INPUTROWS FROM #ALLROWS WHERE [Table] = 2
UPDATE bvc_LineItemModifier SET [Order] = (SELECT ROWNUM FROM #MODIFIERROWS WHERE bvin = bvc_LineItemModifier.bvin) UPDATE bvc_LineItemInput SET [Order] = (SELECT ROWNUM FROM #INPUTROWS WHERE bvin = bvc_LineItemInput.bvin)
DROP TABLE #ALLROWS DROP TABLE #MODIFIERROWS DROP TABLE #INPUTROWS
It will update the tables to add the correct orders for these tables. Let me know your results. |
Justin Etheredge Senior Software Engineer BVSoftware |
|
|
|
Rank: Member
Joined: 6/6/2005(UTC) Posts: 483
|
That fixed it. Thanks Justin.
Bob Noble
|
|
|
|
Rank: Member
Joined: 10/22/2006(UTC) Posts: 74
|
Just wanted to say thanks for posting this fix. I was getting the same error and didn't really want to roll everything back.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.