I have a table which contains a column of datetime
type. I want to query this table using Entity FrameWork given a specific datetime
which inserted by user using datetimePicker
.
The problem is in c# there is no Date
type, only DateTime
exists when ever is inserted it gets the datetime
of that time, for example 24/8/2012 13:02;12
, but when get the value from DatetimePicker
it gives me 24/8/2012 12:00:00
the two date aren't equal because of their times, and Entity Framework, so how to query on date using only date without time , or any alternative idea will be helpful
That is my code
DateTime dt = new DateTime(2012,8,24);
var data = db.Tabel1.where(x=>x.Date.equals(dt));