public List<EmployeesX> GetView()
{
Health_Scheme_System.Health_Scheme_SystemDB db = new Health_Scheme_System.Health_Scheme_SystemDB();
var d = from empView in db.EmployeeDirectories
join empTable in db.Employees on empView.ID_NO equals empTable.EmployeeIDCard
join s in db.Schemes on empTable.SchemeID equals s.SchemeID
select new EmployeesX {ID_NO = empView.ID_NO, FIRST_NAME = empView.FIRST_NAME, LAST_NAME = empView.LAST_NAME, EMPLOYMENT_DATE = ((DateTime)empView.EMPLOYMENT_DATE).Date, TERMINATION_DATE = ((DateTime)empView.TERMINATION_DATE).Date, LOCATION_CODE = empView.LOCATION_CODE };
return d.ToList<EmployeesX>();
}
Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation
9.1k views Asked by Malcolm At
1
Collation refers to the character set used to store data in text fields and is necessary to provide support for all of the many written languages of the world. Each column can have a specific collation defined, or else inherit the collation of the database. You can run into trouble when comparing columns with different collations as a character in one collation is not necessarily equivalent to the same character in another collation.
Either, the columns in this comparison have different collations:
empView.ID_NO equals empTable.EmployeeIDCard
Or, the columns in this comparison have different collations:
empTable.SchemeID equals s.SchemeID
So you need to either change the collations so that they are the same on your database schema:
Or you can add
collate database default
to each of the comparisons in the underlying sql.