Index: System.Data.SQLite/SQLiteConvert.cs ================================================================== --- System.Data.SQLite/SQLiteConvert.cs +++ System.Data.SQLite/SQLiteConvert.cs @@ -38,11 +38,11 @@ /// The format string for DateTime values when using the InvariantCulture or CurrentCulture formats. /// private const string FullFormat = "yyyy-MM-ddTHH:mm:ss.fffffffK"; /// - /// An array of ISO8601 datetime formats we support conversion from + /// An array of ISO-8601 DateTime formats that we support parsing. /// private static string[] _datetimeFormats = new string[] { "THHmmssK", "THHmmK", "HH:mm:ss.FFFFFFFK", @@ -317,11 +317,11 @@ kind == DateTimeKind.Utc ? DateTimeStyles.AdjustToUniversal : DateTimeStyles.None), kind); } - default: + default: /* ISO-8601 */ { return DateTime.SpecifyKind(DateTime.ParseExact( dateText, _datetimeFormats, DateTimeFormatInfo.InvariantInfo, kind == DateTimeKind.Utc ? Index: System.Data.SQLite/SQLiteStatement.cs ================================================================== --- System.Data.SQLite/SQLiteStatement.cs +++ System.Data.SQLite/SQLiteStatement.cs @@ -315,11 +315,15 @@ return; } if ((_flags & SQLiteConnectionFlags.BindAllAsText) == SQLiteConnectionFlags.BindAllAsText) { - _sql.Bind_Text(this, _flags, index, obj.ToString()); + if (obj is DateTime) + _sql.Bind_DateTime(this, _flags, index, (DateTime)obj); + else + _sql.Bind_Text(this, _flags, index, obj.ToString()); + return; } switch (objType) { Index: Tests/basic.eagle ================================================================== --- Tests/basic.eagle +++ Tests/basic.eagle @@ -2344,10 +2344,29 @@ } -cleanup { unset -nocomplain result sql } -constraints {eagle monoBug28 SQLite System.Data.SQLite} -match regexp \ -result {^\{\} 1 System#DBNull#\d+ System#Data#SQLite#SQLiteDataReader#\d+ \{\}\ 1 1 System#Data#SQLite#SQLiteDataReader#\d+$}} + +############################################################################### + +runTest {test data-1.49 {BindAllAsText w/DateTime} -setup { + setupDb [set fileName data-1.49.db] "" Ticks Utc BindAllAsText +} -body { + sql execute $db "CREATE TABLE t1(x);" + + list [sql execute $db "INSERT INTO t1 (x) VALUES(?);" \ + [list param1 DateTime [set dateTime [object invoke DateTime Parse \ + "2000.02.29 13:59:58.1234567Z"]]]] [sql execute -execute reader \ + -format list $db "SELECT x FROM t1;"] +} -cleanup { + cleanupDb $fileName + + unset -nocomplain dateTime db fileName +} -constraints \ +{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ +{1 630874007980000000}} ############################################################################### unset -nocomplain systemDataSQLiteDllFile systemDataSQLiteLinqDllFile \ testExeFile testLinqExeFile northwindEfDbFile testLinqOutFile