I faced this issue twice now.
When I tried to use below code
Type of conditional expression cannot be determined because there is no implicit conversion between '' and 'System.DateTime'
Solution for the problem is below
Reference: Muthukumar (http://nadarmuthukumar.blogspot.in)
When I tried to use below code
DateTime? foo; foo = string.IsNullOrEmpty(txtDate.Text) ? null : Convert.ToDateTime(txtDate.Text);I get error as,
Type of conditional expression cannot be determined because there is no implicit conversion between '
Solution for the problem is below
DateTime? foo; foo = string.IsNullOrEmpty(txtDate.Text) ? (DateTime?)null : Convert.ToDateTime(txtDate.Text);
Reference: Muthukumar (http://nadarmuthukumar.blogspot.in)
0 comments:
Post a Comment