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));
}


 

posted @ 2010-04-12 18:10  庚武  Views(1337)  Comments(0Edit  收藏  举报