mysql 之C#使用insert批量插入时日期字段为null,插入报错解决方案
string nextRepairDate = "''"; if (eqInfo?.NextRepairDate != null) { nextRepairDate = $"'{eqInfo?.NextRepairDate}'"; } insert into table(NextRepairDate) values(IF({nextRepairDate}= '',null,{nextRepairDate}))
string nextRepairDate = "''"; if (eqInfo?.NextRepairDate != null) { nextRepairDate = $"'{eqInfo?.NextRepairDate}'"; } insert into table(NextRepairDate) values(IF({nextRepairDate}= '',null,{nextRepairDate}))