Skip to main content
A newer version of this page is available. .

IConnectionStorageService Interface

Allows you to customize the list of available connections in the Data Source Wizard.

Namespace: DevExpress.DataAccess.Wizard.Services

Assembly: DevExpress.DataAccess.v21.1.dll

NuGet Packages: DevExpress.DataAccess, DevExpress.Win.Design

Declaration

public interface IConnectionStorageService

The following members return IConnectionStorageService objects:

Library Related API Members
Cross-Platform Class Library ConfigureConnectionContext.ConnectionStorageService
EditFiltersContext.ConnectionStorageService
WinForms Controls ConfigureConnectionContext.ConnectionStorageService
EditFiltersContext.ConnectionStorageService

Remarks

The connections list in the Data Source Wizard is populated with connections stored in the application’s configuration file. Implement the IConnectionStorageService interface to initialize, save, and restore connection strings. Register the implemented interface to make the connection strings available in the Data Source Wizard.

Use in Reporting Applications

WinForms

View Example: WinForms End-User Designer - How to customize the data source wizard connection string storage

WPF

Add the implemented interface to the ReportDesigner.ServicesRegistry collection.

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxrud="http://schemas.devexpress.com/winfx/2008/xaml/reports/userdesigner"
        xmlns:dxda="http://schemas.devexpress.com/winfx/2008/xaml/dataaccess" 
        xmlns:dxdaw="clr-namespace:DevExpress.DataAccess.Wizard.Services;assembly=DevExpress.DataAccess.v21.1"
        x:Class="TestDesigner.MainWindow"
        Title="MainWindow" Height="350" Width="525">
      <dxrud:ReportDesigner Name="ReportDesigner">
          <dxrud:ReportDesigner.ServicesRegistry>
              <dxda:TypeEntry ServiceType="{x:Type dxdaw:IConnectionStorageService}" 
              ConcreteType="{x:Type local:CustomConnectionStorageService}" />
              <dxda:TypeEntry ServiceType="{x:Type dxdaw:IConnectionProviderService}" 
              ConcreteType="{x:Type local:CustomConnectionProviderService}" />
          </dxrud:ReportDesigner.ServicesRegistry>
      </dxrud:ReportDesigner>
</Window>

For more information, review the following topic: SqlDataSource - Best Practices for Managing Connection Settings in XtraReports.

Important

Ensure that you protect sensitive connection data to avoid security issues.

Use in Dashboard Applications

The sample code is available in the following example:

View Example: How to define IConnectionStorageService filtering unnecessary connections from app.config

See Also