Is there a way to store byte array in to cql database? I tried with blob but it didn't work. The table still have the blob column but I can't load nor store it. Here the code to create table
CREATE TABLE tb (id int PRIMARY KEY, data blob);
The loading code
public Image convertImgFromByte()
{
string query = "SELECT data FROM tb where id = " +id + " ALLOW FILTERING;";
var results = DataConnection.Ins.session.Execute(query).FirstOrDefault();
byte[] arr = results.GetValue<byte[]>("picture");
using (var ms = new MemoryStream(arr))
{
Image img= Image.FromStream(ms);
return img;
}
return null;
}
Can anyones give me some suggestion?