Mike_Stevens
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.
I am wondering if their is any work around for this.
hi!
This can help you on that:
http://nishantrana.wordpress.com/2007/11/03/saving-richtextbox-control%E2%80%99s-content-rtf-file-in-database/
C# to VB.Net converter:
http://www.developerfusion.com/tools/convert/csharp-to-vb/
This can help you on that:
http://nishantrana.wordpress.com/2007/11/03/saving-richtextbox-control%E2%80%99s-content-rtf-file-in-database/
C# to VB.Net converter:
http://www.developerfusion.com/tools/convert/csharp-to-vb/
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
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
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?