All docs
V21.1
21.2 (EAP/Beta)
21.1
20.2
The page you are viewing does not exist in version 20.2. This link will take you to the root page.
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

MongoDBDataSourceBase.ConfigureDataConnection Event

Allows you to configure connection settings for a MongoDB instance.

Namespace: DevExpress.DataAccess.MongoDB

Assembly: DevExpress.DataAccess.v21.1.dll

Declaration

public event ConfigureDataConnectionEventHandler ConfigureDataConnection

Event Data

The ConfigureDataConnection event's data class is DevExpress.DataAccess.MongoDB.ConfigureDataConnectionEventArgs.

Remarks

A class Fill method call raises the ConfigureDataConnection event. The event occurs only if the class ConnectionParameters property is specified. Handle this event to change connection parameters before the connection to a MongoDB instance is established.

Example

The example below demonstrates how to handle the ConfigureDataConnection event to change connection parameters before a connection to a MongoDB instance is established.

using using DevExpress.DataAccess.ConnectionParameters;
using DevExpress.DataAccess.MongoDB;
//...

private void mongoDBDataSource1_ConfigureDataConnection(object sender, ConfigureDataConnectionEventArgs e) {
    (e.ConnectionParameters as MongoDBCustomConnectionParameters).ConnectionString = "mongodb://localhost:27017";
}
See Also