Reputation: 388
I'm working on connecting to DB2 database from .NET (C#) using the .NET Service Provider IBM.DATA.DB2.dll
(application is a web service which gets details from DB2 database). I have installed DB2 Runtime Client and configured the ODBC and the connection was successful.
When I try to open a DB2 Connection object in the .NET code, I get an error could not find DB2APP.dll
. The dll is available in the DB2 Runtime Client Install Path, but it searches in the bin folder. (I copied it to local machine though it is not right) and it required a new file db2nmp.xml which is also available in runtime client install path but the application is looking under "/WebService ProjectFolder/msg/en_US/db2nmp.xml". I copied that one also and I'm able to connect to DB2. (I clearly think it is not right)
My question is how to force .NET to look in the DB2 Runtime Client install folder instead of searching in the web service project folder? I have tried all possible ways but still could not find an answer. Please help !!!!!
Upvotes: 0
Views: 4324
Reputation: 11063
We work with DB2, and the ISeries installation register the IDM.DATA.DB2 assemblies in the GAC. (Global Assembly Cache).
If you go to c:\windows\assembly
you will see the registered assemblies and you should have them like this:
Using the IBM2.Data.Db2.Iseries
reference should be enough to perform database jobs.
It should find whatever reference needed registered in GAC.
Upvotes: 1