Local DB throws Byte array truncation to a length of 8000 exception

后端 未结 1 592
没有蜡笔的小新
没有蜡笔的小新 2020-12-17 23:38

I\'m trying to take a snapshot from a Map control as a WritableBitmap, convert it to a byte array and save it in the local DB. It works fine (I can convert the byte array ba

相关标签:
1条回答
  • If you look at the SQL Compact docs, you'll see that a binary or varbinary field can be at most 8000 bytes, so that tells me that a byte[] column gets mapped to varbinary. To get it to store data larger than that, you'd need to get the engine to use an image field type. This might be as simple as updating the Column attribute like this (untested):

    [Column(DbType="image")]
    public byte[] LocationImage { ... }
    
    0 讨论(0)
提交回复
热议问题