error while converting string to datetime

Apr 29 2019 1:41 AM
An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code
 
 error is above 
In this line  
 
cmd.Parameters.AddWithValue("@EMP_ATTENDANCE", Convert.ToDateTime(txt_attendance.Text)); 

Answers (2)