Informix .NET Provider, ¿.NET core?
Posted in 2021
juan luis roca asked whether Informix has a .NET Core provider. Sheshnarayan Agrawal and Javier Sagrera said CSDK 4.50.xC4 onward ships one. Jesus Barbery Vargas asked about .NET 5 Entity Framework; Javier advised the IBM Data Server Provider over DRDA. A Windows Docker run then failed loading db2app64.dll; Javier suggested checking the clidriver and VC++ redistributable. Unresolved.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Topics: General Discussion
Hi everyone, One of my customer is developing with .NET Framework, and is connecting to Informix database (ids 12.10 Linux-Inter 64 bits) through "Informix .NET Provider" driver. He claims that this driver does not support .NET Core. Does anyone know if IBM/HCL will develop a .NET Core driver? Thanks a lot, Juan ------------------------------ juan luis roca ------------------------------ #Informix
Hi Juan, CSDK 4.50.xC4 onward Informix .NET Core Provider is made available. Please install the same and use Informix .NET Core Provider. For more information refer below link. https://www.ibm.com/support/knowledgecenter/SSGU8G_14.1.0/com.ibm.cliapinode.doc/ids_net_core.htm Hope this helps.. Thanks -Shesh ------------------------------ Sheshnarayan Agrawal ------------------------------
Hi, Starting with CSDK 4.50.xC4, Informix .NET Core Provider compatible with .NET Core SDK/Runtime v3.1 is shipped for Windows x64 and Linux x86_64 platforms https://www.ibm.com/support/knowledgecenter/SSGU8G_14.1.0/com.ibm.cliapinode.doc/ids_net_core.htm Latest CSDK version is 4.50.FC5. It supports both 12.10 and 14.10 IDS servers. Regards, Javier
Dear Sirs We are wanting to develop microservices using the Entity Framework of .NET 5. If you could provide us with documentation that can guide us on the compatibility conditions that must exist in Informix to be able to connect to that medium, how would you have to build the connection chain to define the context? ? What considerations should be enabled on the servers to be able to allow the connection to the Database using Entity Framework? Thanks for your reply. ------------------------------ Jesus Barbery Vargas ------------------------------
Hi, EF 5.0 is quite old. Are you sure that is what you want to use? If so, there is no native EF provider from Informix, but you should be able to use the 'generic' IBM Data Server Provider for .NET. The IBM Data Server Provider can be used against Db2 and Informix. For Informix you need to use DRDA connections rather than default SQLI connections. Couple of links talking about the provider: https://www.ibm.com/support/producthub/db2/docs/content/SSEPGG_11.5.0/com.ibm.swg.im.dbclient.adonet.doc/doc/c0061053.html https://www.ibm.com/support/producthub/db2/docs/content/SSEPGG_11.5.0/com.ibm.swg.im.dbclient.adonet.doc/doc/c0061050.html and one from the Informix doc regarding how to configure the Informix server for DRDA client (like the IBM Data Server Provider) https://www.ibm.com/docs/en/informix-servers/14.10?topic=communications-configuring-connectivity-between-informix-data-server-clients Regarding the connection string, just make sure you use the details (machine/port) for the DRDA listener. Something like: using System; using IBM.Data.DB2; using System.Data; class simple { static void Main(string[] args) { DB2Connection conn; DB2Command cmd,cmd2; string connstring = "Database=stores7;Server=420ito:9089;Persist Security Info=True;uid=informix;pwd=mypass;"; conn = new DB2Connection(connstring); conn.Open(); cmd = conn.CreateCommand(); where "420ito" is the host where the Informix server is running, and "9089" is the drda port (the "drsoctcp" entry in your sqlhosts file) You can get the .NET EF provider directly from nuget: https://www.nuget.org/packages/IBM.EntityFrameworkCore Hope it helps, Regards, Javier ------------------------------ Javier Sagrera ------------------------------
Dear Javier: It was exactly the part that I was missing. With those concepts that we lacked, we were able to move forward. Eternally grateful. Now we are running into another problem and if it weren't too much trouble in being able to help me. We are already wanting to put the application in a container and we find problems when we want to execute the data consumption through the library. The following message is seen in the docker error log: fail: Microsoft.AspNetCore.Server.Kestrel[13] DllNotFoundException: Unable to load DLL 'db2app64.dll' The specified module could not be found. (0x8007007E) We are wanting to build the docker to run on Windows. I look forward to your comments and thank you very much. ------------------------------ Jesus Barbery Vargas ------------------------------
Is that dll part of the docker image? Is it in a location where it would be found, according to Windows DLL location rules? Does that Windows running in the container follow those rules? ------------------------------ Andreas Legner ------------------------------
Hi, Somehow I missed your latest message. db2app64.dll is the Db2 cli driver, all the DB2 .NET Providers use that underneath. It is part of the dataserver runtime libraries, it is included in one of the package dependencies (Net5.IBM.Dta.Db2) so it should be already in your system. It usually goes to a "clidriver\\bin" directory, so as Andreas mentioned, make sure you have that directory (the whole 'clidriver') in your docker image. If you are on Windows, it would be a good idea to have PATH set to that too, but it may not be required I vagelly remember that it could be 'hardcoded' into the .NET Provider, so it will always try to load the library from a '%NETDIR%/clidriver' (where NETDIR is the directory where the the IBM.Data.Db2.dll lives. Regards, Javier ------------------------------ Javier Sagrera ------------------------------
Thanks Andreas, over your questions: -> Is that dll part of the docker image?: Yes, I can see this and other files in app\\clidriver\\bin. -> Is it in a location where it would be found, according to Windows DLL location rules? yes. -> Does that Windows running in the container follow those rules? yes. we have tried to put the same build in IIS and it works without any problems. ------------------------------ Jesus Barbery Vargas ------------------------------
Thanks Andreas, over your questions: -> Is that dll part of the docker image?: Yes, I can see this and other files in app\\clidriver\\bin. -> Is it in a location where it would be found, according to Windows DLL location rules? yes. -> Does that Windows running in the container follow those rules? yes. we have tried to put the same build in IIS and it works without any problems. ------------------------------ Jesus Barbery Vargas ------------------------------
Dear Javier: We Docker is for Windows. We have applied the following lines to generate the docker: FROM mcr.microsoft.com/dotnet/aspnet:5.0 COPY ["./MyPublish.pub/", "app/"] WORKDIR /app USER ContainerAdministrator RUN setx /m PATH "C:\\app\\clidriver\\bin\\;C:\\app\\;C:\\Program Files\\dotnet\\;C:\\Windows\\system32\\;C:\\Windows\\" RUN echo %PATH%Hemos aplicado las siguientes lineas para generar el docker: USER ContainerUser EXPOSE 80 ENTRYPOINT ["dotnet", "MyPublish.dll"] attentive to your comments ------------------------------ Jesus Barbery Vargas ------------------------------
Hi, Looking at that docker it does looks like you are copying everything from the project dir into the container, so my guess is that the db2app64.dll will be also there. What about VC++ redistributable Maybe it is not the db2 dll but one of their dependecies that is missing. I think there are some samples in vs-dockerfiles/Dockerfile at main · microsoft/vs-dockerfiles · GitHub regarding how to add VC++ redis to a conatiner. Javier ------------------------------ Javier Sagrera ------------------------------