I have the following SQL Server error in ASP.net C#:
The conversion of a varchar data type to a datetime data type resulted
in an out-of-range value.
My SQL query is:
string query = @"update Conference set Conference_name='"
+ name + "',AIMS='" + AIMS + "',Scope='" + scope
+ "',Submission_Deadline='" + submissionDay
+ "',Notification_Deadline='" + notificationDay
+ "',Camera_Ready_submission='" + cameraReadyDay
+ "',Early_authors_registration='" + earlyAuthorsDay
+ "',Start_Date='" + startDay + "',End_Date='" + endDay
+ "',Location='" + location
+ "' where Conference_ID= '" + id+"'";
Perhaps it is time to add some validation. May I suggest the RangeValidator, with type set to Date?