Link to home
Create AccountLog in
Avatar of Mike_Stevens
Mike_StevensFlag for United States of America

asked on

Convert text to RTF in Windows Forms application

I have a SQL database that was upsized from an MS Access Database.  Some of the table fields have text that i want to view and edit in a RichTextFormat control in a Windows Forms application using vb.net.    When i try and populate the richtextbox with the values that were last saved in the access database i get a "File format is not valid" error.  I am assuming that it is because the existing values in the database are just text values and not RTF formatted values.  

I am wondering if their is any work around for this.
Avatar of volking
volking

My first hint, will be to test the RTF control and see if it add's any Beginning or Ending codes.
Open the RTFcontrol
type: Hello World
and save

look at what was saved ... maybe the RTF control wrapped it with something ... like

<RTF_BEGIN>
Hello World
<RTF_END>

Then check what's in your  database ... does it have the same wrapper?


Avatar of Mike_Stevens

ASKER

the control is working properly.  The issue is that i am trying to read exiting data into the control that was previously saved by a regular textbox control
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer