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

VulpesRank #55 · 29.2K reputationPosted Oct 1, 2012, 2:01 AM EDT
Shivanand ArurRank #920 · 2.3K reputationPosted Sep 30, 2012, 10:49 PM EDT
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!!!
Sukesh MarlaRank #461 · 5.4K reputationPosted Sep 30, 2012, 11:14 PM EDT