??????RichTextBox?????????д?????????
private void button1_Click(object sender?? EventArgs e)
{
System.IO.MemoryStream mstream = new System.IO.MemoryStream();
this.richTextBox1.SaveFile(mstream?? RichTextBoxStreamType.RichText);
//?????????????
byte[] bWrite = mstream.ToArray();
//??????д???????
System.Data.SqlClient.SqlParameter[] pram ={
sqlHelper.MakeInParam("@XX"??System.Data.SqlDbType.Image)
};
pram[0].Value = bWrite;
sqlHelper.RunSql("insert into XXX (XX) values (@XX)"?? pram);
}
????????е?RTF?????????RichTextBox
private void button2_Click(object sender?? EventArgs e)
{
//????????ж???????
DataTable dt=sqlHelper.GetDataTable("select XX from XXX where .....");
byte[] bWrite = (byte[])dt.Rows[0][0];
//???????????stream
System.IO.MemoryStream mstream = new System.IO.MemoryStream(bWrite?? false);
//??stream???RichTextBox
this.richTextBox1.LoadFile(mstream?? RichTextBoxStreamType.RichText);
}