富文本保存到mysql中用什么字段类型_将内容富文本编辑器保存到mysql数据库中的blob字段...

在尝试将富文本编辑器(如CKEditor)的内容保存到MySQL数据库的blob字段时遇到问题。ViewModel中ArticleBody为富文本字段,但在控制器的Repository方法中,类型转换错误,无法将'string'转换为'byte[]'。数据库中的'article_body'列可能需要设置为Nvarchar(Max)类型。
摘要由CSDN通过智能技术生成

bd96500e110b49cbb3cd949968f18be7.png

I'm trying to save the content from a rich text editor (ckeditor in my case) to my a blob field in my database.

This is my ViewModel:

public class ArticleViewModel

{

[Required]

[Display(Name = "Title")]

public string Title { get; set; }

[Required]

[Display(Name = "Description")]

public string Description { get; set; }

[Required]

[Display(Name = "Article Body")]

public string ArticleBody { get; set; }

}

The Article Body is my rich text field like this in my view:

@Html.LabelFor(model => model.ArticleBody)

@Html.TextAreaFor(mode

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值