Convert Text to RichText

Anyone have an idea of how to convert Text to RichText? I'm using the VB.Net RichText control to display and save Text in a SQL Server Database. The text needs to be converted and saved as RichText.  Right now, I set the RichTextBox control to the value from the Database but it doesn't display becuase it doesn't have the RTF markup codes.
onyakAsked:
Who is Participating?
 
PAQ_ManCommented:
PAQed with points refunded (500)

PAQ_Man
Community Support Moderator
0
 
RonaldBiemansCommented:
0
 
onyakAuthor Commented:
It's nvarchar.  And it's stored as Text and RichText.  What I need to do is...over time...has the application automatically convert all text to RichText by converting the text to Richtext in the application....unless it's already richtext.

The link you posted did not have the solution.
0
 
onyakAuthor Commented:
Found a solution, but it's not the best solution...

                    Try
                        rtb.Rtf = rt
                    Catch
                        rtb.Rtf = "{\rtf1\ansi\ansicpg1252\deff0\deflang1033" & _
                                "{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}\viewkind4\uc1\" & _
                                "pard\f0\fs17 " & rt.ToString & "\par}"
                    End Try
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.