私は SQLiteDatabas を持っていて、「Data」というフィールドに byte[] を保存したいのですが、この時点で使用している Datetype は Blob と呼ばれ、Byte 配列を SQLiteDatabase に保存するメソッドは次のようになります。
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);
}
SQLiteDatabase のフィールド Data フィールドには、次のテキストが含まれるようになりました: System.Byte[]
実際に実際の byte[] をデータベースに格納したいのですが、どうすればこれを達成できますか? データ フィールドに別の DateType が必要ですか?