-4
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"]);
錯誤:{ 「對象引用不設置爲一個對象的一個實例。」}如何轉換可爲空的DateTime?
這是我的代碼。 fcData
有價值,count =11
和fcData["Diploma.GraduationBeginDate"]
值是10.05.2016
爲什麼它不起作用?你可以幫幫我嗎 ?
可能重複[什麼是NullReferenceException,以及如何解決它?](http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-doi-i-fix - ) –
不,我找不到。 –
請在沒有'.......'的情況下發布更完整的代碼部分。另外 - 當你調試代碼,並排隊我的線在什麼行會拋出異常? –