我的代码是:INT转换为字符串在LINQ to entites的
var currency = (from ac in db.shop
join cur in db.books
on ac.CODE equals cur.CODE.ToString() //here is the Error
// because "ac.code is type strig" & "cur.code is type long
where ac.ID == merchantId
select new Currency()
{
ShopCode = ac.CODE,
PosCode = ac.POSCODE,
}).ToList();
我发现的ToString(),SqlFunctions.StringConvert(长)未在连接查询的条件下工作,但在“选择”工作查询中的区域。 但是Devart.Data.Oracle.Entity.OracleFunctions.ToChar((long)cur.CODE)工作正常。由于我使用的是实体框架,因此它不应该遇到特定数据库类型(即oracle或sql server)的问题。它应该工作,即使我将来从oracle更改为sql。
请给我一个解决方案。
你不能更改列既长或两个字符串? –