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:
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 + "')";
And it shows the following error:
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
So what can I do with the datetime format?