Collision conflict

Is there anyone who knows how we can solve the sorting problem in select linq query? I get this error when I want to select data in linq.

Cannot resolve collision conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in equal action

var lstData = from s in dataTrackDB.datas join b in dataTrackDB.brandDatas on i.brandcode equals b.brandcode join b in dataTrackDB.brandDatas on i.brandcode equals b.brandcode join b in dataTrackDB.brandDatas on i.brandcode equals b.brandcode join m in dataTrackDB.mktDatas on s.mktcode equals m.mktcode select new dataView { Account=m.account, brandcode=b.brandcode, commodity=s.commodity, date=s.date, daysvalid=s.daysvalid, mfrcode=b.mfrcode, mktcode=s.mktcode, price=s.price, prodid=s.prodid, statecode=s.statecode, subcommodity=s.subcommodity, supprecode=s.supprecode, units =s.units }; lstData = lstData.AsQueryable().Where(x => x.mfrcode == mfr ); return lstData.Take(100).ToList(); 
+7
linq linq-to-sql collation
source share
2 answers

The problem is not in Linq, but in your database

you can, for example, create a view that joins this path and select data in linq from the view

 SELECT * FROM T1 INNER JOIN T2 ON T1.Name COLLATE Latin1_General_CI_AS = T2.Name COLLATE Latin1_General_CI_AS 

or first select the data in linq2sql separately for each table, and then attach it to the linq2 object

+4
source share

add COLLATE DATABASE_DEFAULT at the end of the query

0
source share

All Articles