join子句中的一个表达式的类型是在'join'调用中不正确的类型推断失败 [英] The type of one of the expressions in the join clause is incorrect type inference failed in the call to 'join'

查看:486
本文介绍了join子句中的一个表达式的类型是在'join'调用中不正确的类型推断失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有错误

其中一个表达式的类型   join 子句 不正确类型推断失败 ' 加入' 







我尝试了什么:



  var  reff =( from  ep  in  db.Tbl_YouthBasicInfo 
join e db.POCPremiums等于e.YouthID
join p in db.WrapLogic_SCCOC_PotentialCrises on e.POCId equals p.POCId
join v in db.WrapLogic_SCCOC_PotentialCrises_ActionStep on p.PotentialCrisesID equals v.PotentialCrisesId
join b db.WrapLogic_SCCOC_ActionStep_BillableService on v.ActionStepID equals b.ActionStepId
orderby ep.YouthID
选择 new
{
ep.FirstName,
b.RequisitionNo,
b.ServiceStartDate,
b.ServiceEndDate,
b.TotalServiceUnits,
b.TotalCost,

})。ToList();

解决方案

没有剩下的代码,我们不能具体 - 但是错误消息非常清楚:你的一个连接在on操作符的两边没有相同的数据类型。

我首先检查这些:

< pre lang =C#> join p db.WrapLogic_SCCOC_PotentialCrises on e.POCId等于p.POCId
join v in db.WrapLogic_SCCOC_PotentialCrises_ActionStep on p.PotentialCrisesID equals v.PotentialCrisesId
< span class =code-sdkkeyword> join b db.WrapLogic_SCCOC_ActionStep_BillableService on v.ActionStepID equals b.ActionStepId



因为其他人的名字中有ID,这意味着他们应该是类似的类型。


i have error "

the type of one of the expressions in the join clause is incorrect Type inference failed in the call to 'Join'


"

What I have tried:

var reff = (from ep in db.Tbl_YouthBasicInfo
                            join e in db.POCPremiums on ep.YouthID equals e.YouthID
                            join p in db.WrapLogic_SCCOC_PotentialCrises on e.POCId equals p.POCId
                            join v in db.WrapLogic_SCCOC_PotentialCrises_ActionStep on p.PotentialCrisesID equals v.PotentialCrisesId
                            join b in db.WrapLogic_SCCOC_ActionStep_BillableService on v.ActionStepID equals b.ActionStepId                            
                            orderby ep.YouthID
                            select new 
                            {
                                ep.FirstName,
                                b.RequisitionNo,
                                b.ServiceStartDate,
                                b.ServiceEndDate,
                                b.TotalServiceUnits,
                                b.TotalCost,                             
                                
                            }).ToList();

解决方案

Without the rest of your code we can't be specific - but the error message is pretty clear: one of your joins not have the same datatypes on both sides of the "on" operator.
I'd start by checking these:

join p in db.WrapLogic_SCCOC_PotentialCrises on e.POCId equals p.POCId
join v in db.WrapLogic_SCCOC_PotentialCrises_ActionStep on p.PotentialCrisesID equals v.PotentialCrisesId
join b in db.WrapLogic_SCCOC_ActionStep_BillableService on v.ActionStepID equals b.ActionStepId


As the others have ID in their names which implies they should be similar types.


这篇关于join子句中的一个表达式的类型是在'join'调用中不正确的类型推断失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆