I have a SQLiteDatabas and I want to store my byte[] in a field called "Data", the Datetype I'm using at this moment is called: Blob and the method to store the Byte array in the SQLiteDatabase looks like this:
public bool InsertMessage()
{
//create string SQl and fill it with the SQLite query for inserting a message.
string SQL = "Insert into ClockMessages(InsertDateTime, SendDateTime, Data) Values('"+ insertdatetime + "', null, '" + data + "');";
List<SQLiteParameter> pars = new List<SQLiteParameter>();
pars.Add(new SQLiteParameter("InsertDateTime", insertdatetime));
pars.Add(new SQLiteParameter("Data", data));
//send the SQl query and it's parameters to the SQLiteDatabase class
return SQLiteDatabase.ExecuteNonQuery(SQL, pars);
}
The field Data field in my SQLiteDatabase now contains the following text: System.Byte[]
I want to actually store the real byte[] in the Database, how can I achieve this? Do I need another DateType for the Data field?