title: Setting DateTime to empty value c#
body: <p>I am trying to set the date time to an empty value in my application - I am trying in the following way</p>
  
  <pre><code>    string datetime = Convert.ToString(dataRow["dbfield"]).Trim();
      MyDateTime= string.IsNullOrEmpty(datetime)
                      ? (DateTime?) null
                      : GeneralUtilities.ConvertOTDateToDate(datetime);
  </code></pre>
  
  <p>The error I am getting is </p>
  
  <blockquote>
    <p>cannot implicitly convert type System.Datetime? to System.Datetime, an
    explicit conversion exists are you missing a cast?</p>
  </blockquote>
  
  <p>Please could someone help me with the correct syntax required for this please?</p>
  
  <p>Thanks</p>