Monday, December 10, 2012

Date range query in Entity framework

Entity Framework Date rang query is not same as like LINQ.
You can try like this

 var events = this.coreDomainContext.Events.Where(  
   e => EntityFunctions.TruncateTime(e.EventDate.Value) >= DateTime.Today  
    && EntityFunctions.TruncateTime(e.EventDate.Value) <= EntityFunctions.TruncateTime(endPeriod))  
   .OrderByDescending(e => e.EventDate)  

For details you can See

vfpoledeb.1 provider is not registered on the local machine

Have u Install VFP Ole DB Provider in your System ? If No then Please Install it from following link.