(急求高手解决)已添加了具有相同键的项。

问题描述

已添加了具有相同键的项。说明:执行当前Web请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。异常详细信息:System.ArgumentException:已添加了具有相同键的项。源错误:执行当前Web请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。堆栈跟踪:[ArgumentException:已添加了具有相同键的项。]System.ThrowHelper.ThrowArgumentException(ExceptionResourceresource)+52System.Collections.Generic.Dictionary`2.Insert(TKeykey,TValuevalue,Booleanadd)+9381419System.Linq.Enumerable.ToDictionary(IEnumerable`1source,Func`2keySelector,Func`2elementSelector,IEqualityComparer`1comparer)+252System.Linq.Enumerable.ToDictionary(IEnumerable`1source,Func`2keySelector,IEqualityComparer`1comparer)+91System.Web.Mvc.ModelBindingContext.get_PropertyMetadata()+157System.Web.Mvc.DefaultModelBinder.BindProperty(ControllerContextcontrollerContext,ModelBindingContextbindingContext,PropertyDescriptorpropertyDescriptor)+223System.Web.Mvc.DefaultModelBinder.BindProperties(ControllerContextcontrollerContext,ModelBindingContextbindingContext)+93System.Web.Mvc.DefaultModelBinder.BindComplexElementalModel(ControllerContextcontrollerContext,ModelBindingContextbindingContext,Objectmodel)+53System.Web.Mvc.DefaultModelBinder.BindComplexModel(ControllerContextcontrollerContext,ModelBindingContextbindingContext)+1367System.Web.Mvc.DefaultModelBinder.BindModel(ControllerContextcontrollerContext,ModelBindingContextbindingContext)+449System.Web.Mvc.ControllerActionInvoker.GetParameterValue(ControllerContextcontrollerContext,ParameterDescriptorparameterDescriptor)+317System.Web.Mvc.ControllerActionInvoker.GetParameterValues(ControllerContextcontrollerContext,ActionDescriptoractionDescriptor)+117System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContextcontrollerContext,StringactionName)+343System.Web.Mvc.Controller.ExecuteCore()+116System.Web.Mvc.ControllerBase.Execute(RequestContextrequestContext)+97System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContextrequestContext)+10System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5()+37System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0()+21System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult_)+12System.Web.Mvc.Async.WrappedAsyncResult`1.End()+62System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d()+50System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Actionf)+7System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Actionaction)+22System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResultasyncResult)+60System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResultresult)+9System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+9042173System.Web.HttpApplication.ExecuteStep(IExecutionStepstep,Boolean&completedSynchronously)+184

解决方案

解决方案二:
看错误像是绑定Model时有问题*****************************************************************************签名档:http://feiyun0112.cnblogs.com/
解决方案三:
晕啊能结贴吗
解决方案四:
给个解决方案给我再结贴啊。
解决方案五:
很明显key重复了啊你起码贴出出错地方的代码才能给你看吧
解决方案六:
IDictionary<TKey,TValue>.Add方法(TKey,TValue)在添加键值对之前应该先判断是否已经存在该键,可以用ContainsKey方法判断,ContainsKey(键);如果已经存在该键,就直接赋值:dic[键]=值;如果不存在该键,就调用Add方法添加,dic.Add(键,值).
解决方案七:
出错误的地方varurl="/WlSearEdit/List?WFlows_Term_id="+$("#WFlows_Term_id").val()+"&WFlows_user_name="+$("#WFlows_user_name").val()+"&WFlows_state="+$("#WFlows_state").val()+"&WFlows_type="+WFlows_type+"&WFlows_org="+$("#WFlows_org").val()+"&WFlows_deal_person="+$("#WFlows_deal_person").val()+"&Delsite_id="+delsite_id+"&pagetype=Details"+"&time="+newDate().getTime();if($("#WFlows_state00").get(0).checked){url="/WlSearEdit/List?WFlows_Term_id="+$("#WFlows_Term_id").val()+"&WFlows_user_name="+$("#WFlows_user_name").val()+"&WFlows_state=00"+"&WFlows_type="+WFlows_type+"&WFlows_org="+$("#WFlows_org").val()+"&Delsite_id="+delsite_id+"&pagetype=Details"+"&time="+newDate().getTime();}alert(url);parent.addTab("任务详情",url,"");
解决方案八:
你这给的前端代码,错误明显是后端的呀!
解决方案:
publicActionResultList(E3S_WorkList_FlowsS_EWF,stringDelsite_id,int?page,stringpagetype="")
解决方案:
publicclassE3S_WorkList_Flows{[DataObjectField(true)][DisplayName("终端编号")]publicstringWFlows_Term_id{get;set;}[DataObjectField(true)][DisplayName("请求时间")][Description("查询条件:Compare")]publicstringWFlows_gen_date{get;set;}[DataObjectField(true)][DisplayName("工单批次号")]publicstringWFlows_id{get;set;}privatestring_WFlows_type;[DataObjectField(true)][DisplayName("工单类型")][Description("DIC:04+Dic_data")]publicstringWFlows_type{get{return_WFlows_type;}set{_WFlows_type=string.IsNullOrEmpty(value)?"":value.Trim();WFlows_type_name=newDICT().GetDictFromBufByTypeData("0000000004",_WFlows_type).Dic_name;}}privatestring_WFlows_state;[DisplayName("工单状态")][Description("查询条件:IN")]publicstringWFlows_state{get{return_WFlows_state;}set{_WFlows_state=string.IsNullOrEmpty(value)?"":value.Trim();WFlows_state_name=newDICT().GetDictFromBufByTypeData("0000000005",_WFlows_state).Dic_name;}}[DisplayName("派单人")][Description("查询条件:IN")]publicstringWFlows_Allocation_person{get;set;}[DisplayName("工单分配日期")][Description("查询条件:Compare")]publicstringWFlows_Allocation_date{get;set;}[DisplayName("所有人")][Description("查询条件:IN")]publicstringWFlows_deal_person{get;set;}[DisplayName("工单完成日期/时间")][Description("查询条件:Compare")]publicstringWFlows_end_time{get;set;}[DisplayName("客户姓名")]publicstringWFlows_user_name{get;set;}[DisplayName("工单号")]publicstringWFlows_Workid{get;set;}[DisplayName("服务诉求")]publicstringService_demand{get;set;}privatestring_Door_to_door;[DisplayName("是否上门")]publicstringDoor_to_door{get{return_Door_to_door;}set{_Door_to_door=string.IsNullOrEmpty(value)?"":value.Trim();Door_to_door_name=newDICT().GetDictFromBufByTypeData("0000000021",_Door_to_door).Dic_name;}}[DisplayName("用户地址")]publicstringWFlows_address{get;set;}[DisplayName("开户支行")][Description("查询条件:LEqual")]publicstringWFlows_org{get;set;}privatestring_Handle;[DisplayName("是否处理")]publicstringHandle{get{return_Handle;}set{_Handle=string.IsNullOrEmpty(value)?"":value.Trim();Handle_name=newDICT().GetDictFromBufByTypeData("0000000021",_Handle).Dic_name;}}[DisplayName("上次巡检日期/时间")]publicstringWFlows_last_view_time{get;set;}[DisplayName("下次巡检日期/时间")]publicstringWFlows_next_view_time{get;set;}privatestring_Solve;[DisplayName("是否解决")]publicstringSolve{get{return_Solve;}set{_Solve=string.IsNullOrEmpty(value)?"":value.Trim();Solve_name=newDICT().GetDictFromBufByTypeData("0000000021",_Solve).Dic_name;}}privatestring_Transactions;[DisplayName("是否交易")]publicstringTransactions{get{return_Transactions;}set{_Transactions=string.IsNullOrEmpty(value)?"":value.Trim();Transactions_name=newDICT().GetDictFromBufByTypeData("0000000021",_Transactions).Dic_name;}}privatestring_Amount_transaction;[DisplayName("交易金额")]publicstringAmount_transaction{get{return_Amount_transaction;}set{_Amount_transaction=string.IsNullOrEmpty(value)?"":value.Trim();Amount_transaction_name=newDICT().GetDictFromBufByTypeData("0000000022",_Amount_transaction).Dic_name;}}privatestring_Service;[DisplayName("服务情况")]publicstringService{get{return_Service;}set{_Service=string.IsNullOrEmpty(value)?"":value.Trim();Service_name=newDICT().GetDictFromBufByTypeData("0000000020",_Service).Dic_name;}}[DisplayName("解决办法")]publicstringSolution{get;set;}[DisplayName("备注")]publicstringMemo{get;set;}[DisplayName("响应时间")]publicstringResponse_date{get;set;}[Description("外键:工单类型")]//外键publicstringWFlows_type_name{get;set;}[Description("外键:工单状态")]//外键publicstringWFlows_state_name{get;set;}[Description("外键:开户支行")]//外键publicstringWFlows_org_name{get;set;}[Description("外键:所有人")]//外键publicstringWFlows_User_Name{get;set;}[Description("外键:服务情况")]//外键publicstringService_name{get;set;}[Description("外键:交易金额")]//外键publicstringAmount_transaction_name{get;set;}[Description("外键:是否交易")]//外键publicstringTransactions_name{get;set;}[Description("外键:是否解决")]//外键publicstringSolve_name{get;set;}[Description("外键:是否处理")]//外键publicstringHandle_name{get;set;}[Description("外键:是否上门")]//外键publicstringDoor_to_door_name{get;set;}
解决方案:
解决了吗?!!!!!!!
解决方案:
解决了,MODEL中的字段定义错误。
解决方案:
可喜可贺——我是厚颜无耻,来接分的。
解决方案:
好贴,我也遇到这个问题了,再仔细检查下model的定义
解决方案:
是Model中有重复定义的项。楼上正解!!

时间: 2024-08-01 15:16:28

(急求高手解决)已添加了具有相同键的项。的相关文章

ASP.NET MVC 3升级至MVC 5.1的遭遇:“已添加了具有相同键的项”

最近将一个项目从ASP.NET MVC 3升级至刚刚发布的ASP.NET MVC 5.1,升级后发现一个ajax请求出现了500错误,日志中记录的详细异常信息如下: System.ArgumentException: 已添加了具有相同键的项.(An item with the same key has already been added) 在 System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boole

急求高手解决一个GUI连接数据库小程序

问题描述 我有一个swing做的界面,java写的程序,mysql数据库,脚本也有.是学生课程,成绩信息管理的程序但是运行后,注册,登陆了.什么都不行.我感觉是连不到数据库的原因,但是不知道怎么弄,希望哪个高手哥哥,帮我解决一下,谢谢了!我的QQ:309819633邮箱:309819633@163.com急求!!!我是新手没有多少份,希望哪个帮帮忙,谢谢了! 解决方案 解决方案二:把你认为有问题的代码贴出来看看.解决方案三:还需要这样的例子吗?我这自己写的有,是建立在mvc模式上的!需要的话加我

多文件下载~!急 求高手解决下~!谢谢了

问题描述 小弟现在与到一个比较棘手的问题~!我在前些日子做了一个Excel文件下载的程序主要是把数据从库中去出来,然后生成xls文件(就是一个字符串没有创建文件)通过流给客户端传送.但是现在要批量导出问题就来了如何把这些数据写成一个压缩文件,我生成的文件全在内存里也就是说如何生成xls文件对象(不是文件哦)把这些个对象在放到一个压缩包里传回客户端啊~!小弟在线等我的QQ:274454245Mail:angelo8820@126.com真的很急啊~~!大家帮帮我把~!我先谢谢了 解决方案 解决方案

新手有偿求助,急求高手帮忙!!!!!!!!!!!!!!

问题描述 各位大虾:本人新手上路,无奈才进公司不久,就碰上要求我做个课题.对各位来说是小菜一碟,对我来说却好似个大难题了(本人真是还没上路的菜鸟),是一个要求用C++做的公司用的管理系统.现在我已将系统需求写好,就看大家是否肯对我伸出援助之手(不做伸手党,所以有偿也是可以的,具体可私聊),急求能解决燃眉之急的高手!现在到论坛发帖也是万不得已而为之,所以真心求位一睹我帖子的大虾能助我一臂之力.我手机好在这里也写下,13915271363.不过白天比较忙,不一定都能接到各位电话,所以有时候还请多包涵

c++-C++急求复数类已自行解决

问题描述 C++急求复数类已自行解决 求前辈写上思路和注释,我还要看的. 一.编写复数类CMyComplex.实现各种常用构造函数,实现整数.实数向复数的转化函数,实现整数.实数和复数以及复数之间的加.减.乘.除各种运算,并编写输出的成员函数.在主函数中测试. 设计一个MyComplex(复数)类 1.基本信息:实部.虚部: 其中:基本信息为private属性,成员函数为public属性: 2.MyComplex类有多个构造函数:缺省构造函数.带参数的构造函数.带默认参数的构造函数 3.基本功能

sybase启动时遇到的问题!!!!求高手解决,,,急急急!!! xp系统

问题描述 sybase启动时遇到的问题!!!!求高手解决,,,急急急!!! xp系统 00:00:00000:00000:2015/03/10 09:09:00.95 kernel SySAM: Using licenses from: D:sybasedbSYSAM-2_0licenses 00:00:00000:00000:2015/03/10 09:09:01.65 kernel SySAM: Checked out license for 2 ASE_CORE (2013.1231/pe

急求高手帮忙,小女感激不尽啊~~

问题描述 已有一个工程,代码什么的都编写好的现成的,但是我不懂得怎么导入eclipse调试和生成~~~急求高手帮忙 解决方案 解决方案二:file-->import-->general->existingprojectintowrokspace解决方案三:在packageexplorer视图里右击点import也可以方法同上面的解决方案四:记得选上copyprojectsintoworkspace其实这个在百度能查到的,问问题前最后多查查...解决方案五:如果初始工程不是eclipse的

求高手解决struts2问题

问题描述 tomcat运行时出现如下错误:2010-10-2413:59:32org.apache.catalina.core.StandardContextfilterStart严重:Exceptionstartingfilterstruts2Class:com.opensymphony.xwork2.spring.SpringObjectFactoryFile:SpringObjectFactory.javaMethod:getClassInstanceLine:209-com/opensy

求高手解决:0xC0000005: 写入位置 0x00000064 时发生访问冲突

问题描述 求高手解决:0xC0000005: 写入位置 0x00000064 时发生访问冲突 typedef int (_stdcall*FUNA)(unsigned short Codechar* lpDataint lpDatalen);typedef int (_stdcall*FUNB)(char *lpBuf); const char * GetProtocol = ""GetProtocolData"";const char * GetReport =