title: Varchar to datetime data type conversion resulting in an out-of-range value
body: <p>I want to insert the data in SQL database but in SQL query the date format can not be inserted.
  SQL query is the following:</p>
  
  <pre><code>string query1 = "INSERT INTO tbl_mngr_shift_handover_details(status_id,remark,inserted_by,inserted_date)VALUES('" + StatusDropDownList.SelectedValue + "','" + remarkTextArea.Content + "','" + Session["user_id"] + "','" + DateTime.Now + "')";
  </code></pre>
  
  <p>And it shows the following error:</p>
  
  <blockquote>
    <p>The conversion of a varchar data type to a datetime data type resulted
    in an out-of-range value.</p>
  </blockquote>
  
  <p>So what can I do with the datetime format?</p>