Click here to Skip to main content
15,891,749 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Server Error in '/Admin' Application.

Item has already been added. Key in dictionary: 'Int32 Count[Object](System.Collections.Generic.IEnumerable`1[System.Object])'  Key being added: 'Int32 Count[Object](System.Collections.Generic.IEnumerable`1[System.Object])'

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: Item has already been added. Key in dictionary: 'Int32 Count[Object](System.Collections.Generic.IEnumerable`1[System.Object])'  Key being added: 'Int32 Count[Object](System.Collections.Generic.IEnumerable`1[System.Object])'

Source Error: 


Line 856:        IDCCircleDataContext idc = new IDCCircleDataContext();
Line 857:
Line 858:        var qCampaignFilters = idc.Filters.OrderBy(c => c.FilterName);
Line 859:
Line 860:        ddlLoadFilter.Items.Clear();

Source File: d:\IDCC\Website\IDCCircle\Admin\Campaigns\Event\NewSendMailToUsers.aspx.cs    Line: 858 

Stack Trace: 


[ArgumentException: Item has already been added. Key in dictionary: 'Int32 Count[Object](System.Collections.Generic.IEnumerable`1[System.Object])'  Key being added: 'Int32 Count[Object](System.Collections.Generic.IEnumerable`1[System.Object])']
   System.Reflection.CerHashtable`2.Insert(K[] keys, V[] values, Int32& count, K key, V value) +7473762
   System.Reflection.CerHashtable`2.Preallocate(Int32 count) +301
   System.RuntimeTypeCache.GetGenericMethodInfo(RuntimeMethodHandle genericMethod) +240
   System.RuntimeType.GetMethodBase(RuntimeTypeHandle reflectedTypeHandle, RuntimeMethodHandle methodHandle) +438
   System.Reflection.RuntimeMethodInfo.MakeGenericMethod(Type[] methodInstantiation) +320
   System.Linq.Queryable.OrderBy(IQueryable`1 source, Expression`1 keySelector) +213
   Campaigns_Generic_NewSendMailToUsers.BindDDL() in d:\IDCC\Website\IDCCircle\Admin\Campaigns\Event\NewSendMailToUsers.aspx.cs:858
   Campaigns_Generic_NewSendMailToUsers.Page_Load(Object sender, EventArgs e) in d:\IDCC\Website\IDCCircle\Admin\Campaigns\Event\NewSendMailToUsers.aspx.cs:49
   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) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

Version Information: Microsoft .NET Framework Version:2.0.50727.5456; ASP.NET Version:2.0.50727.5456
Posted
Updated 1-Nov-12 23:31pm
v2

1 solution

You add a key to a Dictionary, but the key is added already.
You can't add two equal keys in a Dictionary.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900