Back to Devexpress

ConfigureDataConnectionEventArgs.ConnectionName Property

corelibraries-devexpress-dot-dataaccess-dot-sql-dot-configuredataconnectioneventargs-a2375732.md

latest7.6 KB
Original Source

ConfigureDataConnectionEventArgs.ConnectionName Property

Gets the name of the connection for which the event has been raised.

Namespace : DevExpress.DataAccess.Sql

Assembly : DevExpress.DataAccess.v25.2.dll

NuGet Package : DevExpress.DataAccess

Declaration

csharp
public string ConnectionName { get; }
vb
Public ReadOnly Property ConnectionName As String

Property Value

TypeDescription
String

A String that specifies the name of the connection for which the event has been raised.

|

Remarks

Use the ConnectionName property to identify the currently processed connection. To access parameters of this connection, use the ConfigureDataConnectionEventArgs.ConnectionParameters property.

The following code snippets (auto-collected from DevExpress Examples) contain references to the ConnectionName property.

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.

asp-net-web-forms-dashboard-register-data-sources/CS/WebFormsDashboardDataSources/Pages/OlapDashboard.aspx.cs#L30

csharp
private void ASPxDashboardOlap_ConfigureDataConnection(object sender, ConfigureDataConnectionWebEventArgs e) {
    if (e.ConnectionName == "olapConnection") {
        OlapConnectionParameters olapParams = new OlapConnectionParameters();

asp-net-core-dashboard-register-data-sources/CS/WebDashboardDataSources/Configuration/OlapDataSourceConfigurator.cs#L17

csharp
private static void Configurator_ConfigureDataConnection(object sender, ConfigureDataConnectionWebEventArgs e) {
    if (e.ConnectionName == "olapConnection") {
        OlapConnectionParameters olapParams = new OlapConnectionParameters();

asp-net-mvc-dashboard-register-data-sources/CS/MvcDashboardDataSources/Configuration/OlapDataSourceConfigurator.cs#L17

csharp
private static void Configurator_ConfigureDataConnection(object sender, ConfigureDataConnectionWebEventArgs e) {
    if (e.ConnectionName == "olapConnection") {
        OlapConnectionParameters olapParams = new OlapConnectionParameters();

dashboard-blazor-webassembly-configuration/CS/BlazorDashboardApp/BlazorDashboardApp.Server/Code/DashboardUtils.cs#L16

csharp
configurator.ConfigureDataConnection += (s,e) => {
    if (e.ConnectionName == "jsonSupport") {
        Uri fileUri = new Uri(fileProvider.GetFileInfo("Data/Support.json").PhysicalPath, UriKind.RelativeOrAbsolute);

dashboard-blazor-server-js-customization/CS/BlazorDashboardApp/Code/DashboardUtils.cs#L16

csharp
configurator.ConfigureDataConnection += (s, e) => {
    if (e.ConnectionName == "jsonSupport") {
        Uri fileUri = new Uri(fileProvider.GetFileInfo("Data/Support.json").PhysicalPath, UriKind.RelativeOrAbsolute);

asp-net-web-forms-dashboard-register-data-sources/VB/WebFormsDashboardDataSources/Pages/OlapDashboard.aspx.vb#L28

vb
Private Sub ASPxDashboardOlap_ConfigureDataConnection(ByVal sender As Object, ByVal e As ConfigureDataConnectionWebEventArgs)
    If Equals(e.ConnectionName, "olapConnection") Then
        Dim olapParams As OlapConnectionParameters = New OlapConnectionParameters()

asp-net-mvc-dashboard-register-data-sources/VB/MvcDashboardDataSources/Configuration/OlapDataSourceConfigurator.vb#L17

vb
Private Shared Sub Configurator_ConfigureDataConnection(ByVal sender As Object, ByVal e As ConfigureDataConnectionWebEventArgs)
    If e.ConnectionName = "olapConnection" Then
        Dim olapParams As New OlapConnectionParameters()

mvc-dashboard-separate-server-settings-for-different-views/VB/MvcDashboard_ServerSideApi/Global.asax.vb#L35

vb
Dim databasePath As String = HostingEnvironment.MapPath("~/App_Data/nwind.mdb")
If e.ConnectionName = "Northwind connection" Then
    e.ConnectionParameters = New Access97ConnectionParameters(databasePath, "", "")

WebFormsDashboardConfigurator/VB/WebFormsDashboardConfigurator/Global.asax.vb#L39

vb
Private Sub Default_ConfigureDataConnection(ByVal sender As Object, ByVal e As ConfigureDataConnectionWebEventArgs)
    If e.ConnectionName = "olapConnection" Then
        Dim olapParams As New OlapConnectionParameters()

aspnet-mvc-dashboard-data-federation/VB/MVC_DataFederationExample/App_Start/DashboardConfig.vb#L61

vb
Private Shared Sub Default_ConfigureDataConnection(ByVal sender As Object, ByVal e As ConfigureDataConnectionWebEventArgs)
    If e.ConnectionName = "excelSales" Then
        TryCast(e.ConnectionParameters, ExcelDataSourceConnectionParameters).FileName = HostingEnvironment.MapPath("~/App_Data/SalesPerson.xlsx")

See Also

ConfigureDataConnectionEventArgs Class

ConfigureDataConnectionEventArgs Members

DevExpress.DataAccess.Sql Namespace