简体   繁体   English

Entity Framework 5代码优先于现有Informix数据库

[英]Entity Framework 5 Code First to Existing Informix Database

I am having quite a bit of trouble getting entity framework 5 to work with Informix. 我很难使实体框架5与Informix一起使用。 Looking for any help that I can get. 寻找我能得到的任何帮助。 I followed the following procedure: 我遵循以下过程:

  1. Installed the client SDK (I was unable to install clientsdk.3.70.FC7DE due to an apparent incompatibility with the InstallAnywhere installer and Windows 8, at the recommendation of a colleague I installed clientsdk.3.50.FC9) 安装了客户端SDK(由于我在同事的建议下安装了clientdk.3.50.FC9,因此与InstallAnywhere安装程序和Windows 8明显不兼容,因此我无法安装clientsdk.3.70.FC7DE)
  2. Verified the connectivity to the database via ODBC 通过ODBC验证与数据库的连接
  3. Verified connectivity using the testconn40.exe tool. 使用testconn40.exe工具验证连接。
  4. Added the following connection string: 添加了以下连接字符串:

     <add name="OpenNet" connectionString="Database=*****; Server=*****:40411;User ID=*****;Password=******;Persist Security Info=True;Authentication=Server;" providerName="IBM.Data.Informix"/> 

When I try to query the database, I get a System.Data.ProviderIncompatibleException with the following message: "A null was returned after calling the 'GetService' method on a store provider instance of type 'IBM.Data.Informix.IfxFactory'. The store provider might not be functioning correctly." 当我尝试查询数据库时,收到带有以下消息的System.Data.ProviderIncompatibleException: “在类型为'IBM.Data.Informix.IfxFactory'的存储提供程序实例上调用'GetService'方法后,返回了null。商店提供商可能无法正常运行。”

I de-compiled IBM.Data.Informix.IfxFactory and found the following : 我反编译了IBM.Data.Informix.IfxFactory并发现了以下内容:

Type type = Type.GetType("IBM.Data.Informix.Entity.IfxProviderServices,  
                 IBM.Data.Informix.Entity, Version=9.7.4.4, 
                 Culture=neutral, PublicKeyToken=7c307b91aa13d208", false);

I can't find an assembly for IBM.Data.Informix.Entity anywhere. 我在任何地方都找不到IBM.Data.Informix.Entity的程序集。 Perhaps it was included in the later clientsdk.3.70.FC7DE version that I can install. 也许它可以包含在以后可以安装的clientdk.3.70.FC7DE版本中。 Can anyone tell me if this is going to be possible or if I went down the wrong track at some point? 谁能告诉我这是否有可能或者我在某个时候走错了路?

Right now the only way to get Entity Framework support for IBM database servers are by using IBM DB2 entity provider . 现在,获得对IBM数据库服务器的Entity Framework支持的唯一方法是使用IBM DB2实体提供程序 IBM DB2 entity provider can connect to both DB2 and Informix servers. IBM DB2实体提供程序可以连接到DB2和Informix服务器。

The IBM DB2 entity provider is part of IBM Data Server Driver package. IBM DB2实体提供程序是IBM数据服务器驱动程序包的一部分。 IBM Informix Client SDK also bundles IBM Data Server Driver package as an optional installation module. IBM Informix Client SDK还捆绑了IBM Data Server Driver软件包作为可选安装模块。 Please use the name space IBM.Data.DB2 instead of IBM.Data.Informix. 请使用名称空间IBM.Data.DB2代替IBM.Data.Informix。

FYI: IBM DB2 Provider uses DRDA protocol; 仅供参考:IBM DB2 Provider使用DRDA协议; so it cannot connect to native (SQLI) port of Informix server. 因此它无法连接到Informix服务器的本机(SQLI)端口。 Please enable DRDA protocol at Informix server and specify that port number in the connectivity. 请在Informix服务器上启用DRDA协议,并在连接中指定该端口号。

The URL that you have pointed is for an old release, Doc from relatively new release will have updated information about the Reason Code 7. http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.db2.luw.messages.sql.doc/doc/msql01159n.html 您所指向的URL是针对旧版本的,相对较新版本的Doc将具有有关原因码7的更新信息。http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/com.ibm .db2.luw.messages.sql.doc / DOC / msql01159n.html

The Reason Code 7 on this error is related " Registry key error ". 此错误的原因码7与“ 注册表项错误 ”相关。 Even that information doesn't give much clue for me to give you help; 即使这些信息也不足以帮助我为您提供帮助; but it will give a clue for DB2 DS Driver development team members. 但是它将为DB2 DS Driver开发团队成员提供线索。 I will pass this forum posting information to the DB2 DS Driver development team; 我将把这个论坛发布的信息传递给DB2 DS Driver开发团队。 so that they can help you resolving the issue. 以便他们可以帮助您解决问题。

Most likely the error SQL1159N will get resolve by reinstalling the DS Driver package, you may try that as well. 重新安装DS Driver程序包很可能会解决错误SQL1159N的问题,您也可以尝试这样做。

Here is an FAQ URL for DB2 .NET. 这是DB2 .NET的FAQ URL。 http://www.ibm.com/developerworks/wikis/display/DB2/DB2%20and%20.NET%20FAQs http://www.ibm.com/developerworks/wikis/display/DB2/DB2%20and%20.NET%20FAQs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM