0

When reading json data from webapi I got a datetime column value as '2013-07-26T13:47:58.59'. When trying to insert this value to database using sqlite - an error shows

SQLitePCL.SQLiteException: 'Unable to bind parameter with unsupported type: System.DateTime'

How can I change this datetime format to '2013-07-26 13:47:58.590'?

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
user2431727
  • 877
  • 2
  • 15
  • 46
  • Please post the complete code you are using to insert the value. – Pedro Lamas Nov 21 '17 at 09:46
  • It would be better to show a [MCVE] demonstrate your problem. – Soner Gönül Nov 21 '17 at 10:00
  • Possible duplicate of [Given a DateTime object, how do I get an ISO 8601 date in string format?](https://stackoverflow.com/questions/114983/given-a-datetime-object-how-do-i-get-an-iso-8601-date-in-string-format) – Sean O'Neil Nov 21 '17 at 10:10
  • 1
    SQLite doesn't accept a C# DateTime object as a data type. It needs to be a string formated as ISO 8601 as you seem to have already discovered. And IMO I don't see any reason why this question needs a code example, it's very straight forward. – Sean O'Neil Nov 21 '17 at 10:14

0 Answers0