Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

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



Application Security Testing: An Integral Part of DevOps

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