简体   繁体   中英

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?

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)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM