gpt4 book ai didi

.net - 在 Entity Framework 中将 .NET Boolean 数据类型映射到 oracle number(1,0) 会引发错误

转载 作者:行者123 更新时间:2023-12-03 14:15:56 58 4
gpt4 key购买 nike

将 .NET bool 数据类型映射到 .edmx 文件中的 oracle number(1,0) 会引发以下错误。

Error 2019: Member Mapping specified is not valid. The type 'Edm.Boolean[Nullable=False,DefaultValue=]' of member 'COLUMN123' in type 'DBModel.TABLE123' is not compatible with 'OracleEFProvider.number[Nullable=False,DefaultValue=,Precision=1,Scale=0]' of member 'CHECK_INSTALLATION' in type 'DBModel.Store.TABLE123'.



可以使用 Entity Framework 将 bool 数据类型映射到 oracle 的 number(1,0) 吗?

最佳答案

添加 oracle.dataaccess.client 部分对我来说还不够。以下(取自 Deploying and Configuring ODP.NET to work without installation with Entity Framework )确实有效:

<configuration>
<configSections>
<section name="oracle.dataaccess.client" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</configSections>
...
<oracle.dataaccess.client>
<settings>
<add name="bool" value="edmmapping number(1,0)" />
</settings>
</oracle.dataaccess.client>
<oracle.manageddataaccess.client>
<version number="*">
<edmMappings>
<edmMapping dataType="number">
<add name="bool" precision="1"/>
<add name="byte" precision="2" />
<add name="int16" precision="5" />
</edmMapping>
</edmMappings>
</version>
</oracle.manageddataaccess.client>

关于.net - 在 Entity Framework 中将 .NET Boolean 数据类型映射到 oracle number(1,0) 会引发错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9095695/

58 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com