简体   繁体   English

如何将richtextbox文本保存到带有格式化(粗体,斜体…)的mysql数据库中,并在代码中检索此文本

[英]How to save richtextbox text to a mysql DB with it being formatted(bold, italic…) and retrieve this text within code

我正在尝试将文本从vb.net wpf应用程序中的richtextbox保存到MySQL数据库,其格式相同(粗体,斜体...)。

The key is to use the RTF property, not the TEXT property. 关键是使用RTF属性,而不是TEXT属性。 You can save this to any character field. 您可以将其保存到任何字符字段。

NOTE: Also save the unformatted text for things like searching or reports that don't handle RTF. 注意:还要保存未格式化的文本,以进行搜索或无法处理RTF的报告等操作。 You'll regret it later if you don't. 如果不这样做,您稍后会后悔。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM