P
Peted
Using vs2008 c#
i have this code snipet note: SUBMITTED_DT = DateTime? type
if ((DateTime.Now - billingEvent.SUBMITTED_DT).Days > 180)
{
throw new
BusinessException(Messages.BillingEvent_Save_TooOld);
}
this causes an error on build saying .Days is not supported, and
asking if i am missing an assembly reference.
if i change the code to (ie add SUBMITTED_DT.Value)
if ((DateTime.Now - billingEvent.SUBMITTED_DT.Value).Days > 180)
{
throw new
BusinessException(Messages.BillingEvent_Save_TooOld);
}
then this builds ok, i know its something to do with using DateTime?
but i dont realy understand why.
Can anyone give me a Captain Dummy explanation of why .Value is
required ?
thanks
Peter
i have this code snipet note: SUBMITTED_DT = DateTime? type
if ((DateTime.Now - billingEvent.SUBMITTED_DT).Days > 180)
{
throw new
BusinessException(Messages.BillingEvent_Save_TooOld);
}
this causes an error on build saying .Days is not supported, and
asking if i am missing an assembly reference.
if i change the code to (ie add SUBMITTED_DT.Value)
if ((DateTime.Now - billingEvent.SUBMITTED_DT.Value).Days > 180)
{
throw new
BusinessException(Messages.BillingEvent_Save_TooOld);
}
then this builds ok, i know its something to do with using DateTime?
but i dont realy understand why.
Can anyone give me a Captain Dummy explanation of why .Value is
required ?
thanks
Peter