System.FormatException: String was not recognized as a valid DateTime
Posted on 2006-10-25
DataType in my database is DateTime. But when I try to pass the date from my model,
I am getting the above mentioned error.
There are chances of the string being null sometimes please help.
saved = TaskDAL.Insert(task.AssignedTo.UserID, task.Subject, task.Description, Convert.ToDateTime(task.DateTime), task.NoDateTime, task.Location.LocationGroupID, task.Priority, task.Status, task.Remind, task.Minutes, task.Email, out newTaskID);
task.TaskID = newTaskID;