I've searched for too long but couldn't find any answer.
I'm working on a UWP app which stores BitmapImage data (converted to byte array) into a blob field in an SQLite3 database. However, I can't find a way to retrieve the data once it's saved in the database.
All the solutions I've seen use the GetBytes method from Microsoft.Data.SQLite.SQLiteDataReader but Microsoft's documentation indicates method is "not supported". https://learn.microsoft.com/en-us/dotnet/api/microsoft.data.sqlite.sqlitedatareader.getbytes?view=msdata-sqlite-1.1.0
Can anyone please show some sample code how to retrieve the blob from the SQLite 3 database and convert it to a BitmapImage for display?
Thanks in advance for your help.
reader.GetFieldValue<byte[]>()byte[]to store the bytes then you don't need to use 'GetBytes'. eg- this is your model:public byte[] ImageAsBytes {get; set;}then you can simply access it likevar bytes = db.TableName.ImageAsBytes.FirstOrDefault( r => r.primaryKey == value );