Skip to main content
You are viewing help content for a version that is no longer maintained/updated.
All docs
V21.2
  • SnapDocument.ConfigureDataConnection Event

    Allows you to customize connection settings before connecting to a database.

    Namespace: DevExpress.Snap.Core.API

    Assembly: DevExpress.Snap.v21.2.Core.dll

    NuGet Package: DevExpress.Snap.Core

    Declaration

    event ConfigureDataConnectionEventHandler ConfigureDataConnection

    Event Data

    The ConfigureDataConnection event's data class is ConfigureDataConnectionEventArgs. The following properties provide information specific to this event:

    Property Description
    ConnectionName Gets the name of the connection for which the event has been raised.
    ConnectionParameters Gets or sets parameters used to establish a connection to data.

    Remarks

    This event is intended to correctly process documents, whose multiple instances are opened (e.g., when loading the same SNX file on multiple client machines, and each client is individually connected to the corresponding database using its own credentials). Handling this event is not required when the Query Designer is used to create a new data source from scratch, because the connection string is automatically assigned a unique name.

    Note

    When the SnapDocument is connected to a database using the Query Builder, this event fires if the data source has been restored from the SNX file. If the data source was created using the Query Designer at runtime, this event does not fire.

    Handle this event to change parameters required to establish a connection to data (for instance, the server name, the database name, user credentials, the path to a data file, etc).

    The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ConfigureDataConnection event.

    Note

    The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

    See Also