I am trying to enhance the Iqueryable Find method, very similar to:
public IQueryable<Dinner> FindUpcomingDinners()
return from dinner in db.Dinners
where dinner.EventDate > DateTime.Now
In my GymAttendance, AttnRepository.cs (very similar to DinnerRepository.cs in NerdDinner), I am trying to query the database table on a selected date and the Time from/To, which I have as a float datatype.
public IQueryable<Attendance> FindAttendance(DateTime SelDate, float SelTimeFrom, float SelTimeTo)
return from attendance in db.Attendances
where attendance.GA_Date == SelDate && SelTimeFrom >= attendance.GA_Time_From && SelTimeTo <= attendance.GA_Time_To
orderby attendance.GA_Date, attendance.GA_Time_From
it gives me error:
'>=' cannot be applied to operands of type 'float' and 'string'
SelTimeFrom >= attendance.GA_Time_From
SelTimeTo <= attendance.GA_Time_To
Is this the right way to query multiple fields in a table? What could I do to query the time, which I store as float datatype?
Thanks in advance.