CodeFirst 生成表 当属性 string类型 长度超过数据库最大长度 MSSQL 和MYSQL 报错 返回
C#论坛
老数据
3
3018
悬赏:5 飞吻
CodeFirst 生成表 当属性 string类型 长度超过数据库最大长度 MSSQL 和MYSQL 报错
比如
/// <summary>
/// 文章内容
/// </summary>
[SugarColumn(Length =20000)]
public string Content { get; set; }测试结果 在mysql 中会自动设置为 varchar(max) 在 mysql 中报错
建议解决访问 当超出对应长度 设置为 text类型
热忱回答(3)
-
fate stay night VIP0
2018/4/26ColumnDataType=“text”
0 回复 -
海魂 VIP0
2018/4/26@fate stay night:这是这个功能知道的,不过感觉还是直接规范掉好。。
0 回复 -
边界 VIP0
2018/4/26@fate stay night:ColumnDataType=“text”的话。对应oracle是怎样的呢。还是需要重新改。
0 回复