Good day guys! Currently i am working on a c# project which needs me to retrieve image from .db3 sqlite file and insert it into another .db3 file. I can successfully retrieve the blob data and save it as image in my local drive. There are 3 types of value in my blob which are: hex, text, and image. However, when i tried to retrieve the complete hex value or image i can only retrieve the text value within as text is the one showing in the rows. I have tried searching in several platform and google but still those solution give me the same outcome. In this case, i cannot view the image in the new database file. My code is like this:
rdrall.Read();
string rawimage = ($"{rdrall[5]}") ;
byte[] newByte = ToByteArray(rawimage);
string inserttbl1 = "INSERT INTO newtest3 (image) VALUES (" + "'" + newbyte + "'" + ")";
SQLiteCommand insert = new SQLiteCommand(inserttbl1, createnew);
insert.ExecuteNonQuery();
The outcome should be like this "????": expected output
But turns out like this "system.byte[]": actual output
And the actual output cannot be view as image. Is there anyway to allow me to retrieve the whole value, or just convert the image into the format? Thanks in advance!