I'm getting an error when I try to get the number of days between today's date and a date stored in linqtosql column. What am I doing wrong?
Argument '1': cannot convert from 'System.DateTime?' to 'System.DateTime'
int
days = DateTime.Now.Subtract(linq.ENTRY_DATE).Day;
![]() |
0 |
![]() |
you need to get the datetime value from the nullable datetime.
try it like this:
int days = DateTime.Now.Subtract(linq.ENTRY_DATE.value).Day;
Mike Banavige
~~~~~~~~~~~~
Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/
![]() |
0 |
![]() |
Works great!
thanks
![]() |
0 |
![]() |