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

Convert.ToDateTime does not work in Where clause

1 Answer 87 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.
Oboro
Top achievements
Rank 1
Oboro asked on 09 Oct 2009, 12:36 AM
Am trying to run the following linq query:

var budgetAllocated = from a in _scope.Extent<BudgetDetail>() 
                              where (Convert.ToDateTime(a.DateAllocated).Month == DateTime.Toady.Month) 
                              select a; 

But I keep getting the following error:

Execution of 'System.Convert:ToDateTime(Object)' on the database server side currently not implemented.

Please, can any one help? I have been at this all day.



1 Answer, 1 is accepted

Sort by
0
Oboro
Top achievements
Rank 1
answered on 09 Oct 2009, 06:14 AM
Found a solution, check "Compare DateTime Objects" thread.
Tags
LINQ (LINQ specific questions)
Asked by
Oboro
Top achievements
Rank 1
Answers by
Oboro
Top achievements
Rank 1
Share this question
or