SQLite读写BLOB
代码
SQLiteParameter[] parameters = {
new SQLiteParameter("ID",this.txID.Text.Trim() ),
new SQLiteParameter("KEY",this.txKey.Text.Trim() ),
new SQLiteParameter("CONTENT",DbType.Binary),
};
//ASCIIEncoding asiEnc = new ASCIIEncoding();
//byte[] btContent = asiEnc.GetBytes(strContent);
UTF8Encoding asiEnc = new UTF8Encoding();
byte[] btContent = asiEnc.GetBytes(strContent);
parameters[2].Value = btContent;
//////////////////////////////////////////////////////////////////
byte[] btContent = (reader["CONTENT"] as byte[]);
if (btContent != null) {
//ASCIIEncoding asiEnc = new ASCIIEncoding();
UTF8Encoding asiEnc = new UTF8Encoding();
Response.Write(asiEnc.GetString(btContent));
}