首页 > 解决方案 > 在将数据插入 SQL 时,索引(从零开始)必须大于或等于零且小于 EF 核心中参数列表的大小

问题描述

这是我正在运行的查询。当我直接在 sql 中运行此查询时,它工作正常。如何使其在 EF Core 中无一例外地成功

我知道查询中有一些数据导致了这种情况。我只是想禁用此验证

INSERT INTO public."RxOrder"("OrderId","OrderControl","RxAssignedId","OrderStatus","OrderDateTime","doctorFirstName","doctorLastName","doctorDEA","OrderEffectiveDate","OrderCode","ResidentId","MedicationId","Comments","CommentsSource","OrderBy","CreatedBy","CreatedOn","LastModifiedBy","LastModifiedOn","FillerOrderControl","IsRequestSent","ErrorCode","IsError","MessageControlId","ErrorText","SentHL7Message","IsAckRecieved","Ack","IsResultRecieved","RecievedHL7Message","NAck","OrderTo","DosageForm","DosageUnits","TotalDispensedAmount","TotalDispensedUnits","TotalNoOfRefills","RefillsRemaining","FillNumber","ActualDispensedAmount","ActualDispensedUnits","ActualRefillsRemaining","ActualStrength","ActualStrengthUnit","RxNumber","IsRecieved","OrderUpdatedTheMed","UpdationDone") 
Values(108614,'RF','GOL2\F\134788\F\3145',NULL,NULL,'Sandra','Nettina','','6/24/2016 7:40:18 PM','RX',NULL,101227,NULL,NULL,'iCM',2163,'6/24/2016 7:40:18 PM',NULL,NULL,NULL,False,NULL,True,'16062419401877',NULL,'<div>MSH|^~\&amp;|ICM|9QPF|FrameworkLTC|PCP|20160624194019||OMP^O09^OMP_O09|16062419401877|P|2.5||||||ASCII|||</div><div>PID|1|4361|||Weisenmiller^Anna^^^^^D||19270823|F|||1811 Albert Rill Road^^Hampstead^MD^21074||(410)239-4200||||||215-26-7551|||||||||||N|||||||||</div><div>PV1|1|I|^^^9QPF^^^^||||^Nettina^Sandra |||||||||||||||||||||||||||||||||||||20160506||||||||</div><div>ORC|RF|108614|GOL2\F\134788\F\3145||||||20160624|||^Nettina^Sandra |||20160624||||||Albert Rill Road|1811 Albert Rill Road^^Hampstead^MD^21074|(410)239-4200|||||||</div><div>TQ1|1|^EA|||||20160617||R||TAKE ONE TABLET BY MOUTH IN THE EVENING|||</div><div>RXO|00555083205^WARFARIN TAB |||||||||||||||||||^^||||||||</div><div>NTE|1|P||PI</div><div>EVN|O09|20160624194019|||||9QPF</div>',False,'',False,NULL,'<div>MSH|^~\&amp;|FrameworkLTC|PCP|ICM|9QPF|20160624194120||ACK^O09^ACK|16062419401877|P|2.5||||||ASCII|||</div><div>MSA|AE|16062419401877||||</div><div>ERR|||207|||||Unable to cast COM object of type ''DrugUtil.CDrugPriceClass'' to interface type ''DrugUtil._CDrugPrice''. This operation failed because the QueryInterface call on the COM component for the interface with IID ''{24265817-C356-4070-B2E0-8594095C15F0&#125;'' failed due to the following error: Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)).||||</div>','FLTC',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'249009',False,False,NULL) 
 

标签: sqlpostgresqlentity-frameworkentity-framework-core

解决方案


所以问题是字符{我自己发现我只是通过用&#123基于 html hexa 的字符替换它来临时修复它


推荐阅读