- 优化 IsNullable = false 插入的数据值为 null 则以默认值插入(防止DB报错);#384

This commit is contained in:
28810
2020-08-03 11:58:46 +08:00
parent 2f254d23f9
commit 0b1865f7e7
7 changed files with 19 additions and 21 deletions

View File

@ -67,7 +67,7 @@ namespace FreeSql.Odbc.Dameng
else
{
object val = col.GetMapValue(d);
if (val == null && col.Attribute.IsNullable == false) val = Utils.GetDataReaderValue(col.CsType.NullableTypeOrThis(), null);//#384
if (val == null && col.Attribute.IsNullable == false) val = col.CsType == typeof(string) ? "" : Utils.GetDataReaderValue(col.CsType.NullableTypeOrThis(), null);//#384
if (_noneParameter)
sb.Append(_commonUtils.GetNoneParamaterSqlValue(specialParams, col.Attribute.MapType, val));
else