Answers for "datetime null c#"

C#
1

how to convert nullable datetime datarow to datetime in c#

object sqlDateTime = sqldatareader[0];
DateTime? dt = (sqlDateTime == System.DBNull.Value)
    ? (DateTime?)null
    : Convert.ToDateTime(sqlDateTime);
Posted by: Guest on November-09-2020
0

datetime check null c#

DateTime? datetime = null;

 if (!datetime.HasValue)
 {
     //unassigned
 }
Posted by: Guest on February-15-2022

C# Answers by Framework

Browse Popular Code Answers by Language