title: Input string was not in a correct format with DateTime
body: <p>I have a DatePicker from whose value I am trying to insert to an SQL Server table's <strong>Date</strong> field.</p>
  
  <pre><code>tbl_leave_student updateStdLeave = new tbl_leave_student{
                  leave_from=Convert.ToDateTime( dpLeaveFromStd.SelectedDate.GetValueOrDefault())
              };
              db.tbl_leave_students.InsertOnSubmit(updateStdLeave);
              db.SubmitChanges();
  </code></pre>
  
  <p>This gives a Format Exception with the message </p>
  
  <blockquote>
    <p>Input string was not in a correct format</p>
  </blockquote>
  
  <p>I've tried inserting without the <code>Convert.ToDateTime</code> and also <code>dpLeaveFromStd.SelectedDate (without the .GetValueOrDefault())</code> and got the same error. Any reason why?</p>