Reputation: 856
I need compare two date. One is from databese, second is from now.
var dat = DateTime.Now;
var bd = (from d in....
if (bd != dat)
Date (bd) in database is type "date" so have only data. Date from now (dat) get data with hours so if (bd != dat) cannot compare properly.
Upvotes: 1
Views: 593
Reputation: 3543
You need to use DateTime.Today which will strip out hours.
Upvotes: 3