OLE DB .NET Data Provider
The OLE DB .NET Data Provider uses the IBM®
Db2® OLE DB
Driver, which is referred to in a
ConnectionString
object as
IBMDADB2
.
The connection string keywords supported by the OLE DB .NET
Data Provider are the same as those supported by the IBM OLE
DB Provider for Db2. This provider is no
longer tested. Users are recommended to use the IBM Data Server Provider for
.NET.Also, the OLE DB .NET Data Provider has the same restrictions as the IBM Db2 OLE DB Provider. There are additional restrictions for the OLE DB .NET Data Provider, which are identified in the topic: OLE DB .NET Data Provider restrictions.
In order to use the OLE DB .NET Data Provider, you must have the .NET Framework Version 2.0, 3.0, or 3.5 installed.
For Db2 Universal Database for AS/400 R520, R530 and R540, the following fix is required on the server: APAR ii13348.
All the supported connection keywords for the OLE DB .NET Data
Provider are shown in table 1:
Keyword | Value | Meaning |
---|---|---|
PROVIDER | IBMDADB2 | Specifies the IBM OLE DB Provider for Db2(required) |
DSN or Data Source | database alias | The Db2database alias as cataloged in the database directory |
UID | user ID | The user ID used to connect to the Db2 data server |
PWD | password | The password for the user ID used to connect to the Db2 data server |
Note: For the full list of ConnectionString keywords,
see the Microsoft documentation.
Example of creating an
OleDbConnection
to connect
to the SAMPLE database is: [Visual Basic .NET]
Dim con As New OleDbConnection("Provider=IBMDADB2;" +
"Data Source=sample;UID=userid;PWD=password;")
con.Open()
[C#]
OleDbConnection con = new OleDbConnection("Provider=IBMDADB2;" +
"Data Source=sample;UID=userid;PWD=password;" );
con.Open()