I have a C# 2010 application that I would like to add the following lines of code:
eDataContext rData = new eDataContext();
DateTime complete_date = (DateTime)(from a in rData.cust
where a.PkID == pkId
select a.Complete_Date).FirstOrDefault();
if (complete_date != null)
The linq statement where DateTime complete_date is assigned a value works.
However when I try to executed the line of code
(complete_date != null),
the program has a problem on this line of code. I found this out by stepping though the
code.
Thus can you tell me why the
"if (complete_date != null)" line of code is having a problem? Also can you tell me what to
do to solve the problem?
Loading
VulpesPosted Oct 1, 2012, 6:01 AM
Sukesh MarlaPosted Oct 1, 2012, 3:14 AM
Shivanand ArurPosted Oct 1, 2012, 2:49 AM
For more information on Nullable Datetime check out this site...
http://www.dotnetperls.com/nullable-datetime
PLEASE MARK THE ANSWER AS ACCEPTED IF IT HELPED YOU!!!