MySQL Forums
Forum List  »  Newbie

Cannot load RTF stored in database to richtextbox properly
Posted by: Denis Valjean
Date: May 25, 2014 11:11PM

Hi guys,

Developing my first attempt to build something in C# using mysql database.

My goal is to create a database that stores .rtf files and then, when reading information from a DataGridView, show the rtf content into a richtextbox.

Created my first database with only 3 fields and selected LONG TEXT to the field that would store the rtf files.

To populate the database I created only 3 registers and in the first one (and still inside the sql editor) I right-clicked the register and selected the option "Load Value from Files". Got something like that:



{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch0\stshfloch31506\stshfhich31506\stshfbi31506\deflang1046\deflangfe1046\themelang1046\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f0\fbidi ......


Linked my solution to the database and added a DataGridView and richtextbox already linked (binded?) to the database.

The problem is that the richtextbox shows me the unformatted text descripted above, not the formatted text I want. I can normally load the textfile using the richtextbox.load() method, but I want populate this richtextbox when user clicks the correspondent row in DataGridView.

LONG TEXT is correct? Should I use LongBlob? The error is in saving the rtf inside the database or missing something when loading the register from database? Just studying C# and sql for one week and still many doubts. Thanks in advance.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.