Possible Duplicate:
Conditional operator assignment with Nullable<value> types?
Hi, Why this doesn't work?
DateTime? SomeNullableDateTime = string.IsNullOrEmpty("") ? null : Convert.ToDateTime("01/02/1982");
Is it an error somewhere? The problem seems to be the null because
DateTime? SomeNullableDateTime = string.IsNullOrEmpty("") ? Convert.ToDateTime("01/02/1982") : Convert.ToDateTime("01/02/1982");
Works fine..
Thanks