Eric Schneider wrote: > > That's. For parsing, what about inserts? >
5/25/2013 1:18:20 PM The new connection string property should apply to any operation that requires converting a string to a DateTime or vice-versa (e.g. parsing or formatting). When inserting a row using a parameterized INSERT statement and a strongly typed parameter containing a DateTime, the actual DateTime object will be converted to a string prior to being physically inserted into the database. The parameters governing this conversion process are the DateTimeFormat (enum), DateTimeKind (enum), and DateTimeFormatString (string). By default, the DateTimeFormat (enum) is set to ISO8601, which will not be suitable for strings with a format like "5/25/2013 1:18:20 PM" (i.e. from your original message). Here are some possible solutions to your issue: 1. Set the DateTimeFormat connection string property to CurrentCulture. This is much more relaxed than ISO8601. Set the DateTimeKind to either Utc or Local, depending on which time zone your DateTime values are from. 2. Set the DateTimeFormatString to something that will be able to parse the DateTime values you have (e.g. "M/d/yyyy h:mm:ss tt"). Again, you will also want to set the DateTimeKind to either Utc or Local. 3. Combine #1 and #2. Set DateTimeFormat to CurrentCulture, DateTimeKind to Utc or Local, and DateTimeFormatString to "M/d/yyyy h:mm:ss tt". If none of the above work, there are some additional troubleshooting steps you can take to determine EXACTLY how parameter values are being bound to your statement (e.g. via the LogBind connection flag, which can also be enabled via the connection string). The documentation contains full details on the possible connection flags and their effects. -- Joe Mistachkin _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users