I'm reading values out of a sqlite database using a SqliteDataReader. The first few rows read in fine but then one fails.
I took a peek at the table using SqliteManager and could see it had some corrupted values in. The problem is that any call to rs.GetValue fails - I can't see any way I can test the value without reading it? >> rs.GetValue((int)enuFields.ErrorDateTime); results in an ex.Message of "Invalid format string" and a Stacktrace that looks like this: " at System.DateTime.ParseExact (System.String s, System.String[] formats, IFormatProvider provider, DateTimeStyles style) [0x0005c] in /home/jon/Development/xamarin/mono/mcs/class/corlib/System/DateTime.cs:1761 \n at Mono.Data.Sqlite.SqliteConvert.ToDateTime (System.String dateText) [0x00041] in /home/jon/Development/xamarin/mono/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteConvert.cs:163 \n at Mono.Data.Sqlite.SqliteConvert.ToDateTime (IntPtr ptr, Int32 len) [0x00000] in /home/jon/Development/xamarin/mono/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteConvert.cs:217 \n at Mono.Data.Sqlite.SQLite3.GetDateTime (Mono.Data.Sqlite.SqliteStatement stmt, Int32 index) [0x00000] in /home/jon/Development/xamarin/mono/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLite3.cs:598 \n at Mono.Data.Sqlite.SQLite3.GetValue (Mono.Data.Sqlite.SqliteStatement stmt, Int32 index, Mono.Data.Sqlite.SQLiteType typ) [0x000d3] in /home/jon/Development/xamarin/mono/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLite3.cs:982 \n at Mono.Data.Sqlite.SqliteDataReader.GetValue (Int32 i) [0x00033] in /home/jon/Development/xamarin/mono/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteDataReader.cs:796 \n Here you can see that the ErrorDateTime column has some odd values in the lines that fail: http://mono-for-android.1047100.n5.nabble.com/file/n5120916/sqlite_values.png Anyone got an idea of how I can workaround this? -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/Invalid-format-string-error-using-rs-GetValue-tp5120916p5120916.html Sent from the Mono for Android mailing list archive at Nabble.com. _______________________________________________ Monodroid mailing list [email protected] UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
