Author: sonya_sml | Posted on: 11/4/2009 4:35:00 AM | Views : 674

Hi
I am getting the following error:
Extended Properties: ToString - System.FormatException: String was not recognized as a valid DateTime.
   at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
   at RBI.CCS.DB.BatchDB.ReadBatch(IDataReader dataReader) in xxx.cs:line 223
  
The code is:  batch.SubmitDateTime = DateTime.Parse(dataReader["SubmitDateTime"].ToString());
It reads this dateTime field from database and populates to a C# object's attribute.
Now the problem is that the error: "String was not recognized as a valid DateTime" appeares inter ...

Go to the complete details ...