private DateTime? pApproveDate=null;
pApproveDate =(Reader["ApproveDate"]==DBNull.Value)?null: Convert.ToDateTime(Reader["ApproveDate"]);
Above code is generating the following error during compile time- Type of conditional expression cannot be determined because there is no implicit conversion between '' and 'System.DateTime'
Cast it to DateTime?:
private DateTime?
pApproveDate=null;
pApproveDate =(Reader["ApproveDate"]==DBNull.Value)?(DateTime?)null:
Convert.ToDateTime(Reader["ApproveDate"]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With