Configuring Connection Strings
- Last Updated: April 16, 2026
- 4 minute read
- ADO.NET
- Documentation
The data provider uses a connection string to provide information needed to connect to a specific database server. The connection information is defined by connection string options.
You can define connection string options directly in a connection string or set values in the Advanced Properties dialog box in Visual Studio (see "Defining Connection String Values in Server Explorer").
You can specify an existing connection in the Entity Framework Wizard, or can define a new connection. The ADO.NET Entity Framework uses information contained in connection strings to connect to the underlying ADO.NET data provider that supports the Entity Framework. The connection strings also contain information about the required model and mapping files. The data provider uses the connection string when accessing model and mapping metadata, and connecting to the data source.
Notes:
- On the first connection to a DB2 database, the data provider builds several DB2 packages, a process that can take several minutes. Subsequent connections to that server occur without this delay.
- Make sure that the user who performs the initial connection to a DB2 database has the BINDADD permissions. If the user does not have the BINDADD permissions, the following error message is displayed:
Inadequate permission to create packages on the database server. Packages must be created once on each DB2 server that the DataDirect Connect for ADO.NET DB2 provider will connect to. The provider detected that the packages do not exist on this server and tried to create them, but could not due to the current user not having BINDADD permission on the DB2 server.
Constructing a Connection String
DB2 Data Provider Connection String Options lists the connection string options supported by the DB2 Entity Framework data provider and describes each option. The options have the form:
option=value
Each connection string option value pair is separated by a semicolon. For example, a user with the BINDADD permissions could use the following connection string to make the initial connection:
"Host=10.30.14.109;Port=446;User ID=roger;Password=newm4n;Database=NCANSV5; Collection=ADOVS1"
See Using Connection Strings for guidelines for the syntax and use of connection string options.
Default Values for Connection String Options
The connection string options are described in DB2 Data Provider Connection String Options. The following table lists the supported connection string options and their default values.
Default Values for DB2 Connection String Options
Understanding the DB2 Wire Protocol Driver and Packages
The DB2 Wire Protocol driver works as expected only when packages exist on every server that you intend to connect. The driver can, however, create and bind these packages even if a package does not exist on every server that you intent to connect.
Important: You must have the appropriate privileges for the driver to create and bind packages with your user ID. These privileges are BINDADD for binding packages and GRANT for executing the packages. These are typically the permissions of a Database Administrator (DBA).
When connecting for the first time, the driver checks for the existing packages on the server. If the packages have not been created yet, the driver creates the packages automatically using the default values from the driver data source.
Note: The initial driver connection to a particular server may take a few minutes because of the number, and the size of the packages that must be created on the server. Subsequent connections do not incur this delay.
By default, the packages contain 200 dynamic sections and are created in the collection named NULLID. To override the default number of dynamic sections, you can use the Dynamic Sections option on the Modify Bindings tab of the driver Setup dialog box, or by setting the DynamicSections connection string attribute.
Connection String Option Differences with an ADO.NET Entity Framework Application
| Connection String Option | Behavior in ADO.NET Entity Framework Application |
| Parameter Mode | Ignored |
| Statement Cache Mode | BindByName is the only supported value. |