Error connecting to AS400 (ISeries)

I am trying to connect to an AS400 server using .net classes.
I added a link to IBM.Data.DB.iSeries, and I use the following code:
var conn = new iDB2Connection ("DataSource = 111.111.111.111; UserID = xxx; Password = xxx; DataCompression = True;"); conn.Open ();

But I get the following exceptions: Running 64 bit: "The provider cannot work in 64-bit mode."
32 bit trigger: An unexpected exception occurred. Type: System.DllNotFoundException, Message: Unable to load DLL 'cwbdc.dll': the operating system cannot work. (Exception from HRESULT: 0x800700B6).

I removed client access and installed it again. Cwbdc.dll exists in system32 and syswow64. I have no problem connecting to the AS400 if I use odbc.

I am running a 64 bit version of Windows 7.
Any ideas?

/Jimmy

+4
source share
1 answer

It seems that the driver you are using is not supported on 64-bit systems. In the properties of your project on the "Assembly" tab, set the platform "Target platform" to x86 instead of Any CPU .

+5
source

Source: https://habr.com/ru/post/1304852/


All Articles