Stream Image from MSSQL to rtf String

Posted on 2011-05-09
Medium Priority
Last Modified: 2012-05-11
I have images stored in my table in a column of data type "IMAGE"

In my VB.NET app I am dynamically formatting RTF text in a string and assigining the string to a RichText Edit Control.

Finally beforing assigning the String to the RichEditControl, I want to add an image stored as binary data(IMAGE ) from the database

RtfText+= "{\rtf1\deff0{\fonttbl{\f0 Times New Roman;}}{\colortbl\red0\green0\blue0 ;\red0\green0\blue255 ;}{\*\listoverridetable}{\stylesheet {\ql\cf0 Normal;}{\*\cs1\cf0 Default Paragraph Font;}{\*\cs2\sbasedon1\cf0 Line Number;}{\*\cs3\ul\cf1 Hyperlink;}}\sectd\pard\plain\ql\par\pard\plain\ql\par\pard\plain\ql\par\pard\plain\ql\par\pard\plain\ql\par\pard\plain\ql\par\pard\plain\ql\par\pard\plain\ql\par\pard\plain\ql\par\pard\plain\ql\par\pard\plain\ql\par\pard\plain\ql\par\pard\plain\ql\par\pard\plain\ql\par\pard\plain\ql\par\pard\plain\ql\par\pard\plain\ql\par\pard\plain\ql\par\pard\plain\ql{\*\shppict{\pict\jpegblip\picw5080\pich5080\picwgoal2880\pichgoal2880\picscalex100\picscaley100"

How Do i go about doind that?
Question by:isaackhazi
  • 2
LVL 16

Expert Comment

by:Kalpesh Chhatrala
ID: 35726059
LVL 16

Expert Comment

by:Kalpesh Chhatrala
ID: 35726073
you can check also another sample code to Store RTF to SQL Server

LVL 83

Accepted Solution

CodeCruiser earned 2000 total points
ID: 35727889
You would load the image from Sql Server

and then, using the clipboard, paste it into the richtextbox


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question