user156888
user156888

Reputation:

Sqlite.NET doesn't know about int[]?

When I try to save a model in sqlite.net which has an int[] property I get the following exception:

System.NotSupportedException: Don't know about System.Int32[]

Is this expected? How can I save this - surely it should be ok doing this?

Upvotes: 2

Views: 2067

Answers (2)

Ludwo
Ludwo

Reputation: 6173

You can use byte[] type to store int32[] type. Just split every int into 4 byte values ;)

Upvotes: 1

user195488
user195488

Reputation:

Per the SQLite source code at GitHub, SQLite.NET only supports the following types:

  • Boolean
  • Byte
  • UInt16
  • UInt32
  • Int64
  • Single
  • Double
  • Decimal
  • String
  • SByte
  • Int16
  • Int32
  • DateTime
  • byte[]
  • Guid
  • Enum

Integer arrays are not supported (nor would I expect it to.. can't really turn it into a blob)

Upvotes: 5

Related Questions