This is a migrated thread and some comments may be shown as answers.

Missing field in criteria

1 Answer 78 Views
LINQ (LINQ specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Christian
Top achievements
Rank 1
Christian asked on 03 Feb 2009, 01:10 PM
Hi,
I want to use LINQ for my classes and wrote the following source code:
DateTime CritDate= System.DateTime.Now;  
var ext = scope.extent<clsDepartment>();  
var EL = from DL in ext  
         where DL.Startdate<= CritDate  
         orderby DL.Title  
         select DL;  
List<clsDepartment> Results = EL.ToList<clsDepartment>(); 
By executing the query I recieve the following error message:
Ex {"Field '{CritDate}' not found on class 'clsDepartment'."} System.Exception {Telerik.OpenAccess.OpenAccessException}

That's right: There is no such field, it's the criteria.

An OQL-Query with the same structure works fine.

I need some hint. Thanks.
Christian

1 Answer, 1 is accepted

Sort by
0
Accepted
Zoran
Telerik team
answered on 03 Feb 2009, 02:55 PM
Hello Christian,

I tried to reproduce the reported behavior here locally but I'm afraid I did not manage to. In other words a query of this type executed with no problems. The existence of a problem is not excluded though but, we will require for you to send us sample application so we can identify the problem if it exists or give you specific instructions of how to avoid it.

Looking forward for your feedback.

Greetings,
Zoran
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
LINQ (LINQ specific questions)
Asked by
Christian
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Share this question
or