title: What is standard way to handle Null dates in .NET
body: <p>I have asp.net form with C#, where is I am taking user information to insert in the database as usual  by using Linq. well. Where as I am taking Date of birth also from the user, but if user skip to fill date text box from ui, then I am getting date like '01/01/0001' something like this, which certainly database security would not allow to store it. </p>
  
  <p>So I need to check somewhere in my code that it is null or in this (above given) format. If it is null or in format '01/01/0001' then what exactly I have to do? I don't have any default 
  value for dates.</p>
  
  <p>So what is the standard way to handle if date is null (but not mandatory).Please guide me. So many times I found myself in trap while handling null for various types.</p>
  
  <p><strong>Edited</strong>
  see what i did seems it working here. but i don't think so this is standard way:</p>
  
  <pre><code>DateTime? otxtDOB = new DateTime();
                      if (!string.IsNullOrEmpty(DOB))
                      {
                      if (Convert.ToDateTime(DOB) != DateTime.MinValue)
                          {
                          otxtDateOfPurchese = Convert.ToDateTime(Convert.ToDateTime(DOB).ToString("dd-MMM-yyyy"));
                          }
                      else
                      {
                       otxtDOB = null;
                          }
  
                      }
  </code></pre>
  
  <p>Please confirm me is this right way ?</p>