Skip to content

字典插入中日期字段存在bug #1885

Open
@IM2Pai

Description

@IM2Pai

问题描述及重现代码:

Table数据表中存在日期字段,在使用 InsertDict 插入多行数据时,有些行数据的日期字段有值,有些为空值,在插入数据库后,空值的字段值被插入成了固定值“1970-01-01 00:00:00.000”

// c# code

fsql.InsertDict(dic).AsTable("tableName").ExecuteAffrows();

数据库版本

SqlServer 2012

安装的Nuget包

.net framework/. net core? 及具体版本

.Net 6

微信图片_20240913194158

微信图片_20240913194159

ToSql()的语句如下

INSERT INTO [T_Pai_FormTest_SubLister]([T_Pai_FormTestID], [ID], [SubCheckBox], [SubTextBox], [SubTextArea], [SubDatePicker], [SubComboBox], [SubButtonEdit], [SubButtonEditName], [SubSingleFile], [SubSingleFileName], [SubSpinner], [SortIndex], [IsReleased], [UpperVersionID]) VALUES(N'b1ea0143-d55c-4e0f-9412-0c9ec1c25eb7', N'b1ea0143-e1ec-45c8-93f4-3afaa89f9eed', NULL, N'数据行1', NULL, '2024-09-13 00:00:00.000', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL), (N'b1ea0143-d55c-4e0f-9412-0c9ec1c25eb7', N'b1ea0143-e1ec-4657-8a7f-f2ea4762582c', NULL, N'数据行2', NULL, '1970-01-01 00:00:00.000', NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL)

数据库中的表字段也是允许为空值的
微信截图_20240913194913

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions