The string was not recognized as a valid DateTime. There is an unknown word starting at index 0.
Getting error below line.
cmd.Parameters.AddWithValue("@D_Date", Convert.ToDateTime(date));
private void Insert(DateTime inttime,DateTime outtime,string date)
{
using (SqlCommand cmd = new SqlCommand("Sp_Get_Absent", con))
{
cmd.Parameters.AddWithValue("@Action", "Update");
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@EmpID", lbid.Text);
cmd.Parameters.AddWithValue("@INTIMe", inttime);
cmd.Parameters.AddWithValue("@OutTime", outtime);
cmd.Parameters.AddWithValue("@D_Date", Convert.ToDateTime(date));
con.Open();
cmd.ExecuteNonQuery();
ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", " alert('Time saved sucessfully');", true);
con.Close();
}
}