This is seemingly easy task and yet I can't get this to worl so please give me your pointers. I have a SQL
table that has one of its columns of DateTime
type. I want to access it from ASP
application via LinqDataSource
. I want to provide WHERE
parameter to LinqDataSource
from Calendarcontrol
(that returns DateTime
as SelectedDate). I want to display set in GridView
. Seems easy, doesn't it? But regardless of what I do I get an error at runtime:
Operator '==' can not be applied to operands of type
DateTime
and Object which makes no sense to me because Calendar returnsDateTime
andLINQ
class also returnsDateTime
for that column. How would you approach this task or this problem. I can't useSqlDataSource
because ofSQL
served andIIS
security configuration that currently I do not want to touch.
Unfortunatelly it is impossible to perform this wiring declaratively. Instead load your query with filters into a List<>)_ and bind GridView to it in C# code.