OleDbConnectionStringBuilder Constructor (String^)
Initializes a new instance of the OleDbConnectionStringBuilder class. The provided connection string provides the data for the instance's internal connection information.
Assembly: System.Data (in System.Data.dll)
Parameters
- connectionString
-
Type:
System::String^
The basis for the object's internal connection information. Parsed into key/value pairs.
| Exception | Condition |
|---|---|
| ArgumentException | The connection string is incorrectly formatted (perhaps missing the required "=" within a key/value pair). |
Setting the Provider property, either directly (by setting the ConnectionString property) or by passing a connection string as a parameter to the constructor, may affect the set of key/value pairs that are contained within the OleDbConnectionStringBuilder instance. Setting the Provider property to "sqloledb," for example, adds all the standard SQL connection string properties. See the example in this topic for a demonstration of this behavior.
For some providers, assigning a connection string within the OleDbConnectionStringBuilder constructor causes the order of supplied key/value pairs to be rearranged.
The following example creates multiple OleDbConnectionStringBuilder instances, passing a different connection string to the constructor in each case. Note how setting the provider associated with the connection changes the set of predefined key/value pairs within the object's collection.
Note |
|---|
This example includes a password to demonstrate how OleDbConnectionStringBuilder works with connection strings. In your applications, we recommend that you use Windows Authentication. If you must use a password, do not include a hard-coded password in your application. |
Available since 2.0
