RichTextBox .rtf ---> Sql Server as image

Moorzee

Well-known member
Joined
May 31, 2006
Messages
92
Location
England
Programming Experience
3-5
Hello all.

Have any of you ever stored the contents of an rtb as an IMAGE in SQL Server 2000? I have gotten as far as storing the text(formatted) from a rtb with
VB.NET:
.Parameters.Add([SIZE=2][COLOR=#800000]"@Main_Body"[/COLOR][/SIZE][SIZE=2], SqlDbType.Image).Value = Encoding.Unicode.GetBytes(rtbNewsItem.Rtf)[/SIZE]

but as soon as the getbytes hits an image I have pasted into the RTB it is not entered into the DB nor any text after that point?

Do you think this is even possible?

Cheers

Moorzee.
 
After messing about with this all day I decided to check the rtf I was writing to the sql server and guess what...... My image was simply referenced as ole embedded so no way of showing image!!!!!

Problem was I was simply copying image from ms paint or whatever and pasting into the RTB with ctrl+v. So instead I am using an insert image button and creating an image object from the selection in openfiledialougue, setthis image to the Clipboard then a simple call to the richtextbox.paste() adds the image to the rtf with all the metafile data.

Messy but it works.

Cheers.
 
Back
Top