i have this query in my code I am getting this Error.
var auditMandate = (from ae in genDB.AuditEvent
join at in genDB.AuditTable on // snip
select ae)
.OrderByDescending(x =>
x.DateTime_Updated).Take(500)
.Distinct().ToList();
An error occurred while executing the command definition. See the inner exception for details.
The xml data type cannot be selected as DISTINCT because it is not comparable. The xml data type cannot be selected as DISTINCT because it is not comparable.
is that something I am doing wrong this Linq?
Thanks
This is doable. Take the query you have but get rid of the Distinct call. You still want a concrete list however so keep ToList(). Then follow this idea (since I don’t know your xml structure):
My Table
My Data
My Comparer
My Code