在SQL中保存广告显示Richt文本 [英] Save ad Display Richt Text in SQL
问题描述
亲爱的所有人;
我已经构建了一个ac#winform应用程序,每次使用都会使用具有(粗体,斜体,下划线,对齐方式,FontColor)功能的RTF输入注释,然后他将其注释保存在数据库中,以便我要使用使用的格式.
在保存和插入数据时,我使用了以下代码:
Dear All;
I have build a c# winform application, Each use will enter comments using a richtext with ( Bold, Italic,Underline , alignment, FontColor ) features , then he will save his comment in the database , so that I want to display the comments with the used formats.
while saving and inserting data I have used this line of code :
com.Parameters.Add("@cmts", SqlDbType.NText).Value = rtbDoc.Rtf;
而且我使用了webbroswer控件来显示数据(我选择了webbrowser控件是因为它易于使用html表显示和设计数据)
而且我选择显示注释为textarea字段.但是它显示的是这样的评论:
And I have used a webbroswer control to display data ( I have choosed webbrowser control because it is easy to display and desgin the data using html tables )
And I choosed to display the comments is textarea field. But it is displaying the comments like that :
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}
\viewkind4\uc1\pard\qc\b\f0\fs17 Tamer Hatoum\par
\pard I am sending for testing \ul My software\ulnone\b0\par
}
那么如何以相同格式的文本显示它呢?
问候.
So how can display it in the same formated text ??
Regards.
推荐答案
您需要在富文本框中显示此文本,才能以格式化文本的形式查看此文本.
You will need to display this text in a rich text box to view this text as formatted text.
这篇关于在SQL中保存广告显示Richt文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!