score:1
Could you please check your table with sp_help to see if there is a different collation in the columns.
There is also a very through explanation on that issue here
score:0
You could make the query a bit easier, and avoid the issue, and I think this should "work":
from a in dc.ContentList
where a.ContentID != null
select new { ID = a.ContentID, a.PriceClass, .. }).Union(
from b in dc.ContentList
where dc.ContentList.FirstOrDefault(a => a.ContentID == b.ContentID) == null)
select new { ID = b.ContentID, b.PriceClass, .. });
Source: stackoverflow.com
Related Articles
- Strange collation issue using LINQ to SQL
- Convert string[] to int[] in one line of code using LINQ
- Left outer join using LINQ -- understanding the code
- How to reuse a linq expression for 'Where' when using multiple source tables
- Avoiding code repetition when using LINQ
- Using LINQ to delete an element from a ObservableCollection Source
- LINQ Source Code Available
- Getting common values in two array issue using LINQ
- Using multiple Contains taking time to load performance issue in Linq
- Using collation in Linq to Sql
- How can I write the following code more elegantly using LINQ query syntax?
- How can I code an outer join using LINQ and EF6?
- C# .Net 3.5 Code to replace a file extension using LINQ
- LINQ returning strange value using Select on a string
- Strange Exception thrown using Dynamic Linq Entity Framework Query
- Trying to understand LINQ code using c#
- Retrieve bool result by using LinQ code
- creating Linq to sqlite dbml from DbLinq source code
- read icollection data using LINQ in C# code
- Linq sub query when using a repository pattern with EF code first
- Using LINQ query result for data source for GridControl c#
- Casting issue when using LINQ Select New
- TransactionScope, linq and strange transaction manager issue (HRESULT: 0x8004D024)
- LINQ to SQL bug (or very strange feature) when using IQueryable, foreach, and multiple Where
- How to flatten a multi level XML into a single level XML using c# code LINQ
- Using Linq to build a graph class; can you make this code look better?
- How to write this code using the Linq Extension Method-Syntax?
- Code Rewite for tuple and if else statements by using LINQ
- How can I check the number of calls to the database in LINQ query when using .NET Core and Code First?
- Can't add a new record with an integer value into database by using linq from code C#
- Homework: HowTo obtain multiple keys collection?
- Query a dictionary to get top 3 most common elements
- Linq with DefaultIfEmpty with select new {}
- c# asp.net: Cannot compare elements of type 'System.Int32[]'. Only primitive types, enumeration types and entity types are supported.'
- How to concat item in list with condition
- Dynamic query with WCF RIA Services
- How to create a tree list from a list
- How to extend the ADO.NET entity designer?
- Linq/C#: How to split List into variable length chunks based on list item information?
- Custom config section with non-ConfigurationElement properties
- Get range in ordered collection
- Entity Framework Include and Navigation Property
- linq how to get values from var
- Linq query and casting in c#
- Difference of a set of floating-point numbers using LINQ
- Sort item based on another collection item
- Get raw list from OrderedEnumerable
- Only capture element with Linq to XML if parent is of specified type
- Entity Framework 6 comparing two arrays or sequences
- lambda expression function body to sql query