简体   繁体   中英

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. 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)
  2. Verified the connectivity to the database via ODBC
  3. Verified connectivity using the testconn40.exe tool.
  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."

I de-compiled IBM.Data.Informix.IfxFactory and found the following :

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. Perhaps it was included in the later clientsdk.3.70.FC7DE version that I can install. 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 DB2 entity provider can connect to both DB2 and Informix servers.

The IBM DB2 entity provider is part of IBM Data Server Driver package. IBM Informix Client SDK also bundles IBM Data Server Driver package as an optional installation module. Please use the name space IBM.Data.DB2 instead of IBM.Data.Informix.

FYI: IBM DB2 Provider uses DRDA protocol; so it cannot connect to native (SQLI) port of Informix server. Please enable DRDA protocol at Informix server and specify that port number in the connectivity.

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

The Reason Code 7 on this error is related " Registry key error ". 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. I will pass this forum posting information to the DB2 DS Driver development team; 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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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