ASCII Text in SQL2k
Here's my question...I have a Rich Text control bound to a field in SQL2k.
When I append data to the field from the control, the value from the rich
text control's .text property is surrounded by ASCII code relating to the
font parameter, et al of the control.
What is the best way to prevent the control from appending this ASCII information
to the SQL2k field.
Re: ASCII Text in SQL2k
Rich Text Format (which is used by the Rich Text control) is a tag based
format. Essentially, it has some definite similarities to HTML in terms of
how it notes formatting issues. Since you are using an RTF control, you're
getting RTF information.
Since you are using binding, you don't really have much control over what
property the data is bound to. For the RTF control, it binds to the TextRTF
property instead of the Text property. If you want only the actual text
stored, then you need to either use a straight text control or get away from
binding and use straight code to store the Text property. As an alternative,
you could go through the process of creating your own custom control by
essentially subclassing the RTF control. That's not a huge deal for
something as simple as what you want, but is also not trivial if you haven't
done it before.
My recommendation? Write the ADO (or your object model of choice) code to
write the text property out directly rather than binding. It will meet your
need better and perform better to boot.
Rob Vieira MCSD, MCT, MCDBA
"Roger" <firstname.lastname@example.org> wrote in message news:email@example.com...
> Here's my question...I have a Rich Text control bound to a field in SQL2k.
> When I append data to the field from the control, the value from the rich
> text control's .text property is surrounded by ASCII code relating to the
> font parameter, et al of the control.
> What is the best way to prevent the control from appending this ASCII
> to the SQL2k field.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center