Skip to main content

IConnectionStorageService Interface

Allows you to store the data connection settings in WinForms and WPF applications.

Namespace: DevExpress.DataAccess.Wizard.Services

Assembly: DevExpress.DataAccess.v24.1.dll

NuGet Packages: DevExpress.DataAccess, DevExpress.Win.PivotGrid, DevExpress.Win.TreeMap

Declaration

public interface IConnectionStorageService

The following members return IConnectionStorageService objects:

Remarks

The connections list in the End-User Report Designer‘s 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 End-User Report Designer:

  • Windows Forms

    Add the implemented interface to the XRDesignMdiController.

    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.v24.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. For instance, you can use the SqlDataConnection.BlackoutCredentials method to remove user credentials from connections strings.

See Also