entity-framework - Entity Framework 5 IBM DB2 EntityException 底层提供程序在 ConnectionString 上失败

标签 entity-framework frameworks db2 entity

我正在使用 Visual Studio 2012 构建 Web 应用程序。该应用程序使用 Web 表单、带有 IBM DB2 数据库服务器的 Entity Framework 5。我的开发机器和 Web 服务器上都安装了最新的 IBM Drivers v10.1.2。 Web 服务器正在运行 Windows Server 2008 R2 Standard x64 位操作系统

我遇到的问题是在本地计算机上的 Visual Studio 的 IIS Express 下运行该应用程序工作正常,但是当我将应用程序部署到 Web 服务器时,我遇到了 EF 和 DB2 驱动程序问题。这是错误和堆栈跟踪。做错了什么?!

Server Error in '/' Application.
--------------------------------------------------------------------------------


 ERROR [] [IBM][CLI Driver] SQL0000W  Statement processing was successful. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: IBM.Data.DB2.DB2Exception: ERROR [] [IBM][CLI Driver] SQL0000W  Statement processing was successful.

Source Error: 




An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace: 





[DB2Exception (0x80004005): ERROR [] [IBM][CLI Driver] SQL0000W  Statement processing was successful.]
   IBM.Data.DB2.ConnSettingsFromXmlConfig.ProcessFromXmlConfig(DB2Connection connection, String dbname, String host, String port, String tmpClientEncAlg, String tmpAuthentication, String prevdb, String prevdb_ori, DB2ConnSettings& sSettings, DB2ConnSettingsInternal& sSettingsInternal, StringBuilder& modifiedValue) +21370
   IBM.Data.DB2.DB2ConnPool.ReplaceConnectionStringParms(DB2Connection connection, String szValue, DB2ConnSettings& pSettings, DB2ConnSettingsInternal& pSettingsInternal, Boolean bAttach, Boolean pushDownStrAppended) +19113
   IBM.Data.DB2.DB2Connection.set_ConnectionString(String value) +187
   System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +325

[EntityException: The underlying provider failed on ConnectionString.]
   System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +391
   System.Data.EntityClient.EntityConnection..ctor(String connectionString) +43
   System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(ConnectionStringSettings appConfigConnection) +78
   System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config) +32
   System.Data.Entity.Internal.LazyInternalConnection.Initialize() +127
   System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel() +13
   System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +281
   System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +18
   System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +52
   System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +15
   System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +37
   System.Linq.Queryable.Where(IQueryable`1 source, Expression`1 predicate) +63

.... 

最佳答案

我遇到了同样的问题,并将应用程序池更改为网络服务就解决了问题。

关于entity-framework - Entity Framework 5 IBM DB2 EntityException 底层提供程序在 ConnectionString 上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15916744/

相关文章:

sql - 如何在 DB2 中运行 SQL 并返回漂亮的 XML

sql - 如何将两个记录合并为一行?

asp.net-mvc - 延迟加载类未加载 - MVC

c# - 从 DbCommandDefinition 获取 CommandText

Java 2d 图形动画框架

c++ - 创建一种接口(interface) C++

c# - EntityFramework Core 2 默认值

entity-framework - 在 Entity Framework Where 子句中使用标志

php - 何时使用框架或从头开始开发 PHP Web 应用程序

db2 - 如何在 DBArtisan 9.6 中设置默认 DB2 模式