Friday, February 24, 2012

How to Store Font and Size Information

Hi,

I am trying to store RichTexBox information, such as the formating of the paragraph, color, font and etc. Is that possible to store this kind of information in Sql Server 2005 Compact Edition without stripping down the properties one by one?

I am trying to store a sentence which contain of multiple color or font for different words. Is there anyway to store those information?

thanks.
You can store the entire RTF contents of the control to a ntext field in SQL CE.|||

ErikEJ wrote:

You can store the entire RTF contents of the control to a ntext field in SQL CE.

But what "container" should we use in C# ? a stream?

thx!

|||

SQL CE’s ntext maps to "string" in C#. That's what RTF is - a string with special markup.

You can, however, use Image type in the database and a byte array in C# which you can access via MemoryStream if string is not good enough.

|||

Ilya Tumanov wrote:

SQL CE’s ntext maps to "string" in C#. That's what RTF is - a string with special markup.

You can, however, use Image type in the database and a byte array in C# which you can access via MemoryStream if string is not good enough.

thanks

No comments:

Post a Comment