Missing field in criteria

2 posts, 1 answers
  1. Christian
    Christian avatar
    81 posts
    Member since:
    Aug 2008

    Posted 03 Feb 2009 Link to this post

    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.
  2. Answer
    Zoran avatar
    534 posts

    Posted 03 Feb 2009 Link to this post

    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.

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
Back to Top