datetime字段在列表中带了时区,比如插入12-6号的数据,在sql中显示的是12-5
![](https://images0.cnblogs.com/blog/36543/201312/06131217-0572048ad9574034b280bfcda89343bb.png)
![](https://images0.cnblogs.com/blog/36543/201312/06131217-29d338774a634528a240aa004b41881a.png)
date类型字段无法正确识别,插入成功但报错
LobSystem (外部系统)为实体(外部内容类型)“BDI,http://10.136.240.66/kpi”的“创建”创建方法返回的标识符为 Null。
![](https://images0.cnblogs.com/blog/36543/201312/06131218-2d401b354a334e67be753b9381962953.png)
解决:
1.SPD导出BDC模型,并从SPD中删除
![](https://images0.cnblogs.com/blog/36543/201312/06131218-0a9d1df8ad5d49fea6497f7165aaff9d.png)
2.VS打开编辑
![](https://images0.cnblogs.com/blog/36543/201312/06131219-4b3f87b2d04247b6b78ecfaf50aea2ce.png)
![](https://images0.cnblogs.com/blog/36543/201312/06131219-27bc711c786a45f3be7d8c23650a60b2.png)
3.修改以下内容
本地时区:<NormalizeDateTime LobDateTimeMode="UTC" /> 为 <NormalizeDateTime LobDateTimeMode="Local" />
只显示日期部分:<Property Name="Format" Type="System.String">DateOnly</Property>
显示两位小数:<Property Name="Decimal Digits" Type="System.Int32">4</Property>修改为<Property Name="Decimal Digits" Type="System.Int32">2</Property>
<Parameter Direction="In" Name="@PublicDate">
<TypeDescriptor TypeName="System.DateTime" CreatorField="true" IdentifierName="PublicDate" Name="PublicDate" DefaultDisplayName="日期">
<Interpretation>
<NormalizeDateTime LobDateTimeMode="UTC" />
</Interpretation>
</TypeDescriptor>
</Parameter>
改为
<Parameter Direction="In" Name="@PublicDate">
<TypeDescriptor TypeName="System.DateTime" CreatorField="true" IdentifierName="PublicDate" Name="PublicDate" DefaultDisplayName="日期">
<Properties>
<Property Name="Format" Type="System.String">DateOnly</Property>
</Properties>
<Interpretation>
<NormalizeDateTime LobDateTimeMode="Local" />
</Interpretation>
</TypeDescriptor>
</Parameter>
4.保存文件并在管理中心导入
![](https://images0.cnblogs.com/blog/36543/201312/06131220-31a5135ff206447aaf8c1821aa38074a.png)
![](https://images0.cnblogs.com/blog/36543/201312/06131220-2488ae9aa80e439ca14c9c91cf53a291.png)
![](https://images0.cnblogs.com/blog/36543/201312/06131221-af6b9979b51e49aebd2e8b2d61efa2c0.png)