This article introduces you to the development instance of the background database using DB2 in Visual Studio. NET and detailed steps for your reference.
In Studio. NET Beta 1, accessing non-SQL Server databases such as IBM DB2 is usually using the ODBC method of ADO. NET, while in Beta 2, OLE DB is used to access the database.
The connection string in Beta1 mainly needs to declare the odbc dns name of the database, but the ole db connection string in Beta 2 is complicated and the classes used are also different. Because DB2 and other databases are widely used in mainframe and other applications,. NET will naturally fully support such programming. For this reason, the DB2 development of ole db will be described below.
Ole db for DB2 driver
First, Visual Studio. NET and Windows 2000 Server do not directly provide the DB2 ole db driver. Therefore, you need to download the Microsoft Host Integration Server 2000 software, which contains ole db Provider and ODBC driver for DB2, you need to download the Server software package and select to install Data Integration during installation. After the installation is complete, you can use its ole db DB2 driver.
Set database connection
First, we need to configure the DB2 client settings, open the server resource manager in the View menu item, and add a new connection to its data connection, when specifying program options, select Microsoft ole db Provider for DB2. In the next connection options, enter the following information:
Data Source: QCDB can be modified as appropriate)
IP Address: Address of the Database Server
Network Port: DB2 service Port
Username: User Name for Database Access Permissions
Password: the user's Password.
Database initial Catalog: QCDB
Package collection: QCDB
Default schema: Userid