public class MC_VARIABLES { public DateTime? OPT_EXP; public DateTime? mOPT_EXP { get { return mOPT_EXP; } set { mOPT_EXP = value; } } } public void DTE() { decimal DTE; foreach (KeyValuePair<int,> KVP in dctMC) { if (KVP.Value.OPT_EXP.HasValue) { DateTime TDY = DateTime.Now; DateTime EXP = KVP.Value.OPT_EXP; //cannot implicitly convert system.datetime? to system.datetime....not sure how to fix this TimeSpan DaysToExp = TDY - EXP; DTE = (decimal)(DaysToExp.TotalDays) / 365; } } }
DateTime EXP = KVP.Value.OPT_EXP.Value;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)