Why does this fail?
This code throws an InvalidCastException, on the grounds that you can't convert a DateTime to anything else but a string. But I didn't think I was converting a DateTime: I thought I was converting a nullable DateTime.
ETA: The answer.
Tomorrow I will research this.DateTime? nDate = new DateTime? (DateTime.Today);Convert.ChangeType(nDate, typeof(DateTime?));
ETA: The answer.
0 Comments:
Post a Comment
<< Home