Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: SQL Server
Expertise: Beginner
Jul 20, 2000



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Storing RTF Text

I'm trying to store text that's in an RTF format using the TextRTF property of VB's RichTextBox control. What type of field do I have to use in my table?

The data in a rich text box actually is still text, but it contains tags for all the text formatting. So the rich text for a string that is bold, italic, underlined in Times Roman 14 point looks like this:

{\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}
{\f1\froman\fcharset2 Symbol;}{\f2\fswiss MS Sans Serif;}
{\f3\froman\fprq2 Times New Roman;}} {\colortbl\red0\green0\blue0;} \deflang1033\pard\plain\f3\fs28\b\i\ul Carpe diem.\plain\f2\fs17 \par }
Therefore, you can save data from a rich textbox to a SQL Server column with text data type. If you're using ADO, the field type will be adLongVarChar.
DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date