Reputation: 16623
I'm trying to connect to IBM DB2 database with C# application. At first I've installed IBM Data Server Driver Package
, which, according to the documentation is for applications using ODBC, CLI, .NET, OLE DB, PHP, Ruby, JDBC, or SQLJ, use IBM Data Server Driver Package. Then I thought I could use IBM.Data.DB2
assembly and happily connect. It didn't work at all, as the app kept crashing while looking for db2app.dll
in its current working directory.
Then I installed IBM Data Server Client
, which has this dll in "bin" directory, which I added to system path. That didn't help, so I copied it to my app's build directory, and it now works. But I don't think that is correct, as I also had to copy msg\en_US\db2nmp.xml
file to my build directory to get exception error texts.
I think it's wrong to copy all these files from DB2 installation, and I should somehow be able to force IBM.Data.DB2
assembly to look for its required files in the system path, not in its working directory. I also think that Data Server Driver Package
should be enough, but I wasn't able to do anything with IBM.Data.DB2.dll
until I installed the larger Data Server Client
.
I assume that the problem is on my end, not with IBM, so I'm doing something obviously or subtly wrong.
My question is: How do I use the smaller IBM Data Server Driver Package
with .NET application?
Upvotes: 1
Views: 4899
Reputation: 285
I think you are looking for this information that is available in DB2 manual: http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.swg.im.dbclient.adonet.doc/doc/c0010960.html
And perhaps this helps also: http://www.ibm.com/developerworks/wikis/display/DB2/DB2%20and%20.NET%20FAQs#DB2and.NETFAQs-WherecanIfindtheDB2.NETproviderandVSAddins%3F
In general, I think you should've installed IBM Database Add-Ins for Visual Studio from here(Requires IBM Registration): https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?source=swg-daivs
Upvotes: 1