6

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?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Polyfun
  • 9,479
  • 4
  • 31
  • 39

1 Answers1

6

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.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Shekhar_Pro
  • 18,056
  • 9
  • 55
  • 79
  • Is there a download link for that provider? Also please see my edit. – Polyfun Feb 23 '11 at 16:16
  • 1
    @Shekhar_Pro I'm still not able to download IBM's provider... Is there a download link on the page you suggested? – tyron Nov 29 '11 at 17:45
  • You can get the latest Microsoft provider from [Microsoft SQL Server 2017 Feature Pack](https://www.microsoft.com/en-us/download/details.aspx?id=55992) – user942620 Mar 26 '18 at 19:35