title: DateTime accepts null value
body: <p>In the web app I'm working on, the web app should be able to accept null <code>DateTime</code>values, because customers might be hesitant to give information about their Date of Birth. Of course, this won't be an easy task, because in C#, <code>DateTime</code> is not nullable. </p>
  
  <pre><code>DateTime rawBirthDate = Convert.ToDateTime(txtDOB.Text);
  fxTxn.BirthDate = rawBirthDate;
  </code></pre>
  
  <p>with that, I had to change my code to accept a null value:</p>
  
  <pre><code>DateTime? rawBirthDate = string.IsNullOrEmpty(txtBirthDate) ? (DateTime?)null : DateTime.Parse(txtBirthDate);
  fxTxn.BirthDate = Convert.ToDateTime(rawBirthDate);
  </code></pre>
  
  <p>this code, in turn, returns <code>1/1/0001 12:00:00.000 AM</code>. However, MSSQL throws a <code>DateOutOfRangeException</code>, saying the date must be between 1/1/1753 and 12/31/9999.</p>
  
  <p>I'm completely stuck in here. On my SQL table, I allowed the <code>BirthDate</code> column to accept null values. Question now is, how do I make C# consider null DateTime values? The end result would be that, if the Customer did not provide Date of Birth information, the system should still be able to save the record but the BirthDate column in the customer's record would still be NULL.</p>