IBM Support

How to register .NET provider after installation of DB2

Technote (troubleshooting)


Problem(Abstract)

If you install or upgrade the .NET Framework after installing DB2, how do you register the DB2 .NET provider?
 

Symptom

DB2 .NET Provider does not appear in the .NET Assembly
 


Cause

The DB2 installation process will register the DB2 .NET provider, but only if a .NET Framework is already installed.
 

Resolving the problem

Use the 'db2nmpsetup' command to register the .NET Provider. Open a DB2 Command Window

and execute


    db2nmpsetup -l c:\db2nmpsetup.log

Review c:\db2nmpsetup.log. The end of the log will look similar to this:

    The db2 install path is: "C:\Program Files\IBM\SQLLIB"
    To register Data Provider into machine.config. The command line is:
    "C:\Program Files\IBM\SQLLIB\BIN\db2nmpcfg.exe" -register -level 9.5.3 -db2path "C:\Program Files\IBM\SQLLIB" -migratev8 -migrateids
    Return code from db2nmpcfg.exe is: 0
    Data Provider is registered to machine.config successfully.
    To register Data Provider into SSRS. The command line is:
    "C:\Program Files\IBM\SQLLIB\BIN\db2nmpcfg.exe" -reportserver_register
    Return code from db2nmpcfg.exe is: 0
    Data Provider is registered to SSRS successfully.

You can check the Assembly (C:\Windows\Assembly) and verify that both of the following exist:


    IBM.Data.DB2 9.0.0.1 (for .NET Framework 1.0)

    IBM.Data.DB2 9.0.0.2 (for .NET Framework 2.0 and higher)


'db2nmpsetup' is also executed by 'Configure DB2 .NET Data Provider' from Start -> Programs -> IBM DB2 -> DB2COPY1 -> Set-up Tools. This does not generate a log file, however.

In db2 v9.5 and 9.7, the db2nmpsetup command is deprecated. The db2lswtch command should be used instead. Open a DB2 Command Window and execute


    db2lswtch -client -promote

and check the Assembly to verify that the IBM DB2 .NET Providers are now registered. 

Related information

db2lswtch (v9.7)
db2lswtch (v9.5)

Historical Number

44307
370
000

Document information

More support for: DB2 for Linux, UNIX and Windows
Programming Interface - .NET/.NET ADO

Software version: 9.7, 10.1, 10.5, 11.1

Operating system(s): Windows

Software edition: Enterprise Server, Express, Personal, Personal Developer's, Workgroup Server

Reference #: 1429586

Modified date: 12 July 2016