I am trying to connect to an Informix database using the Informix.Net.Core.dll in an asp.net core 6.0 web api. I have set the path to InformixDir\bin directory on my machine and have used setnet32 to define an Informix Server and a Host. I have installed System.Security.Permissions nuget package(4.4) but still my web api throws the exception that this package is not found(on IfxConnection).
These are the steps I followed:
string _connectionString = "Host=<IPADDRESS>;Service=<PortNumber>;Protocol=onsoctcp;Server=<DBServer Name>;Database=<DBNAME>;User Id=<UID>;Password=<PASSWORD>;DB_LOCALE=en_US.819;CLIENT_LOCALE=en_US.819;":
con = new Informix.Net.Core.IfxConnection(_connectionString); //it fails on this line
await con.OpenAsync();
IfxCommand cmd = new IfxCommand("mySPName", con);
cmd.CommandType = CommandType.StoredProcedure;
IfxDataAdapter ifxAdpter = new IfxDataAdapter(cmd);
System.Data.DataSet ifxDS = new System.Data.DataSet();
ifxAdpter.Fill(ifxDS, "emp");
This might help anyone trying to code an asp.net core web application connecting to Informix database.
Upgrade the Informix.Net.Core package to the latest available in Nuget Package Manager.