Exception Details: System.FormatException: The string is not recognized as a valid DateTime.
Solution:
Convert a type when the date is saved to the SQLite database, for example: string _now = System.DateTime.Now.ToString ("s");
In other words. The ToString () method solves the problem of a date reading error by adding an S.
Simple code example:
String _indate = request["Indate"]; The date entered is as follows: 2009-2-21
DateTime _intime = Convert.todatetime (_indate);
The following is the SAVE data SQL statement
Insert into table (indate) VALUES (' "+ _intime.tostring (" s ") +" '); convert here
Because of the description of ISO 8601: (http://msdn.microsoft.com/zh-cn/library/ms187819.aspx)
Gives an example of a string:
* 2004-05-23T14:25:10
* 2004-05-23T14:25:10.487
So SQLite saves the date to be converted to ISO 8601 standard string format
Use date. ToString ("s"); This method is converted to the ISO 8601 standard string format.
An issue with the SQlite database "The string was not recognized as a valid DateTime"