string fc = .......
Dictionary<string, string> fcData = serializer.Deserialize<Dictionary<string, string>>(fc);
if (!string.IsNullOrWhiteSpace(fcData["Diploma.GraduationBeginDate"]))
DateTime? GraduationBeginDate = Convert.ToDateTime(fcData["Diploma.GraduationBeginDate"]);
错误:{&#34;对象引用未设置为对象的实例。&#34;}
这是我的代码。 fcData
有价值,count =11
和fcData["Diploma.GraduationBeginDate"]
值为10.05.2016
为什么它不起作用?你可以帮帮我吗 ?
答案 0 :(得分:1)
您可以将DateTime影响到DateTime吗? :
DateTime t1 = someDate;
DateTime? t2;
t2 = t1; <- it works
相反:
DateTime? t1 = someDate;
DateTime t2;
t2 = t1; <- won't work, you need to cast it
t2 = (DateTime)t1;
希望这会有所帮助。