Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET DB2 OLEDB pre-requisites

Tags:

c#

.net

db2

I have written a Windows Forms application in C#, .NET framework 2.0, that uses System.Data.OleDb to talk to an SQL Server 2000 database, which is working fine. I now need to enhance the application to talk to an DB2 database on AS/400. Is this just a matter of configuring the connection string, or do I need additional driver software (where from) and/or references in my project?

I would like to still use OLEDB, but with DB2.

Edit: I downloaded the Microsoft OLE DB Provider but was unable to install it onto my desktop development PC because I do not have SQL Server installed. This provider seems to be only for integrating SQL Server with DB2, whereas I want to integrate a Windows Forms application with DB2. Is there a different download location for an OLE DB provider that does not require SQL Server, which I can use from a Windows desktop?

like image 202
Polyfun Avatar asked Feb 23 '11 16:02

Polyfun


People also ask

What is Microsoft OLE DB Provider for Db2?

Microsoft OLE DB Provider for DB2 works with Microsoft SQL Server to connect SQL applications and tools to IBM Db2 databases.

How do I choose an Oledb provider?

In SSIS Designer, double-click on your OLEDB connection manager to open the Connection Manager window. In the Provider drop-down list, select Microsoft OLEDB Driver for SQL Server.

How do I install Microsoft OLE DB Provider for SQL Server?

To install the OLE DB Driver for SQL Server, you need the msoledbsql. msi installer. Run the installer and make your preferred selections. The OLE DB Driver for SQL Server can be installed side-by-side with earlier versions of Microsoft OLE DB providers.

How do I know if my OLE DB provider is installed?

Each provider has a GUID associated with its class. To find the guid, open regedit and search the registry for the provider name. For example, search for "Microsoft Jet 4.0 OLE DB Provider". When you find it, copy the key (the GUID value) and use that in a registry search in your application.


1 Answers

You will can use Microsoft's OLEDB for DB2 provider for this. Also the connection string will change.

Like:

Provider=DB2OLEDB;Network Transport Library=TCPIP;Network Address=xxx.xxx.xxx.xxx;Initial Catalog=MyCtlg;Package Collection=MyPkgCol;Default Schema=Schema;User ID=myUsername;Password=myPassword;

Or you can use IBM's own IBM OLE DB Provider for DB2 that works without SQL Server.

You should look at Connection strings for IBM DB2 for all other providers and their configuration.

like image 69
Shekhar_Pro Avatar answered Oct 11 '22 06:10

Shekhar_Pro