Print Page | Close Window

EntityQuery.AddOrderBy

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2047
Printed Date: 23-Apr-2025 at 8:56am


Topic: EntityQuery.AddOrderBy
Posted By: hojo
Subject: EntityQuery.AddOrderBy
Date Posted: 05-Aug-2010 at 2:47am
Dear reader,
 
using IdeaBlade DevForce Classic v3.7.1.0 we have encountered the following problem:
 
when using AddOrderBy() with an EntityQuery myquery using a nullable EntityColumn, there is a problem when using this query with pm.GetEntities<T>(myquery), _if_ the database actually contains null-values (for this column).
[I might add that myquery also uses "TOP", though I don't know whether that makes any difference.]
 
In this case the following error message appears:
 
http://www.ideablade.com/forum/uploads/886/EntityQuery_AddOrderBy.zip - uploads/886/EntityQuery_AddOrderBy.zip
 
If the table does not contain null-values (for this column) the query and ordering works fine.
 
If reading the entities into a list (without ordering) and using ApplySort afterwards on the list (for this column), ordering works fine.
 
[Unfortunately this seems to be no solution to us: using TOP the result set is just different, depending on whether sorting is used on SQL-level.]
 
Anyway, I would expect ordering to work already on SQL-level, whether the column is nullable or not, and whether there are null-values or not.
 
Can you reproduce this behaviour? Is there a solution to this?
 
Thanks for your reply
Jörg
 



Print Page | Close Window