How to save RichTextBox content in Access2010

前端 未结 2 905
青春惊慌失措
青春惊慌失措 2021-01-23 13:57

I\'m creating a dictionary system, where words meaning is editable in RichTextBox (for user define FontSize, Color, etc...)

So how to can I save meaning

2条回答
  •  生来不讨喜
    2021-01-23 14:44

    Native Rich text in Access 2007/2010/2013 uses a subset of HTML, not RTF, so unless you want to convert to/from RTF<>HTML when you load/save your data, you will have to find another way to store your formatted text.

    Since the WPF RichText control uses RTF, the best way to save data in an Access database would probably be to use a binary blob.
    In Access, you can do this either by using the OLE Object data type or, better, the new Attachment data type.

    If you want to be able to do a text search on the text entered through the RichText control, you should probably add another Memo field to your database containing the cleaned-up, pure-text version of the data.

    To work with attachments from .Net, here are a couple related questions:

    • How to use Microsoft Access Database's Attachment Data Type?
    • Programmatically managing Microsoft Access Attachment-typed field with .NET

提交回复
热议问题