4

I am developing a .net core 2.1 API that needs to connect to an older Ingres DB.

In previous .net frameworks I have been able to use Ingres Client found here https://www.nuget.org/packages/Ingres.Client/1.0.1

However this is not compatible with .net core 2.1 and the last update was about 3 years ago! Some key files are missing which is causing runtime errors.

Exception thrown: 'System.IO.FileNotFoundException' in System.Private.CoreLib.dll

So I just wondered if anyone had any experience with connecting to Ingres from .net core 2.1 and knew of a way to do it. Or any suggestions or strategies to try would be appreciated.

Regards.

G.James
  • 230
  • 1
  • 10
  • 1
    So to get round this I decompiled the Ingres.Client from Actian and fixed the missing files issue. The main problem is System.EnterpriseServices is not available in Core, but simply creating the ITransaction interface seems to have worked out. So far I am able to communicate with my Ingres DB, I have not done anything too complicated, but seems to be going OK! – G.James Jul 04 '18 at 08:08
  • Do you have the recompiled dll to share, @G.James? – Narvalex Oct 23 '18 at 12:53
  • 1
    @G.James, could you please post your code here. – Ram Singh Jan 18 '19 at 11:04

1 Answers1

2

I managed to do this with Ingres ODBC driver. Available drivers in Windows are accessible from: Control Panel > Administrative Tools > ODBC Data Source Administrator. Select 'Add...' to find the name of installed Ingres ODBC driver (e.g. 'Ingres XC').

var connectionString = "Driver=Ingres XC;Server=@<db-server-ip>,tcp_ip,II;UID=ingresuser;PWD=password;database=mydatabase";

using (OdbcConnection connection = new OdbcConnection(connectionString))
{
// ...
}
Mangala
  • 45
  • 7