我正在使用linq to SQL以及运行此查询时
var lstData = from s in dataTrackDB.datas
join m in dataTrackDB.mkts on s.mktcode equals m.mktcode
join n in dataTrackDB.mktnews on m.mktcode equals n.oldmktcode
select new data
{
AccountDes = m.account,
commodity = s.commodity,
date = s.date,
daysvalid = s.daysvalid,
mktcode = s.mktcode,
mktDes = n.mktdesc,
price = s.price,
prodid = s.prodid,
statecode = s.statecode,
subcommodity = s.subcommodity,
supprecode = s.supprecode,
units = s.units
};
我将得到“无法解决”SQL_Latin1_General_CP1_CI_AS“和”Latin1_General_CI_AS“之间的校对冲突等于操作”。如果有人指导我如何编写linq查询,我会感激不尽的?
谢谢
答案 0 :(得分:1)
问题在于数据库中列的collation
,将它们更改为相同的排序规则。
在列上设置排序规则可能会影响sql中的比较运算符。
http://www.sqldbadiaries.com/2010/10/31/changing-sql-server-collation/
http://blog.sqlauthority.com/2008/12/20/sql-server-change-collation-of-database-column-t-sql-script/