Save RTFData to database without TextArea.RTFData

I have a TextArea and I read and write the RTFData in a database column.

Write:
rs.Column(“notes”).StringValue = EncodeBase64(TextArea1.StyledText.RTFData)

Read:
var s as new StyledText
s.RTFData = DecodeBase64(rs.Field(“notes”).NativeValue)
TextArea1.StyledText = s

Now I import a string from a text file that should be added to the column “notes” in the database.
I have tried this:

var n as new StyledText
n.RTFData = EncodeBase64(“MyString”)
rec.Column(“notes”) = n.RTFData

After this I have data in the column, but I can’t read it. I got no text string

Has anyone a solution for this?

Logically, I would say:

rs.Column("notes").StringValue = EncodeBase64(MyString)

or

var n as new StyledText n.RTFData = EncodeBase64(MyString) // No quote, use the variable holding name rec.Column("notes") = n.RTFData

But, it is 2:24 at night and by brain can run slow (and be wrong).

[quote=486385:@Horst Jehle]var n as new StyledText
n.RTFData = EncodeBase64(“MyString”)
rec.Column(“notes”) = n.RTFData[/quote]

If the file has RTF, why would you encode as base 64 before loading it with RTFData ?

why loading it to a RTFData anyway?