I am doing an app which inclueds richTextBox, for inserting text. I put some text into richTextBox and save it into my sql database (column is varbinary(MAX) data type, with this code:
byte[] myFile = Encoding.UTF8.GetBytes(richTextBox1.Text);
Here the text is changed into binary data, and them I add parameters and all whats needed, and finally:
cmd1.ExecuteNonQuery();
Then, when I want to open it, it opens in word (the code is made, that it opens in this program - depending on an extention and a file type).
So, when the Word is starting up, 1st it asks me if I want to change it (to use some other coding). I select nothing and click Ok. The text is there but it is not in the shape I inserted it into richTextBox. The font are all the same and are in Courier New (I didn`t save the the text in with this font, and even the text was not all the same).
Anyone has any clue how to get the same text out, as I saw inserted into richTextBox? Is this maybe anything to do with richTextBox, or this is only a matter of coding?