Register Default Data Connections
- 2 minutes to read
This document describes how to provide a Web Dashboard with a set of data connections. These connections are available in the Data Source Wizard when users create new data sources.
The Data Source wizard does not show this page by default. Set the DashboardDesignerDataSourceWizardSettings.ShowConnectionsFromAppConfig property to true to display this page.
To add a predefined data connection, register it in the application’s configuration file by adding a corresponding connection string to the connectionStrings section. For instance, the following connection string allows end users to establish a connection to the Northwind database deployed on a local MS SQL server (SQL Data Source):
<configuration>
<connectionStrings>
<add name="nwindConnection" connectionString="XpoProvider=MSSqlServer; data source=localhost; initial catalog=Northwind; integrated security=SSPI;" />
</connectionStrings>
</configuration>
You can also add data connections to connect to OLAP cubes:
<configuration>
<connectionStrings>
<add name="adventureWorksConnection" connectionString="Provider=MSOLAP; Data Source=https://demos.devexpress.com/Services/OLAP/msmdpump.dll; Initial catalog=Adventure Works DW Standard Edition; Cube name=Adventure Works;" />
</connectionStrings>
</configuration>
The JSON Data Source is also supported:
<configuration>
<connectionStrings>
<add name="customersConnection" connectionString="uri=https://raw.githubusercontent.com/DevExpress-Examples/DataSources/master/JSON/customers.json" />
</connectionStrings>
</configuration>
See Custom Connection Strings for Data Sources for information on how to specify a custom connection string.
The Dashboard Data Source Wizard can also display inherited connection strings (for instance, connection strings from machine.config). To remove strings from machine.config, add the clear element before the application’s connection strings:
<connectionStrings>
<clear/>
...
</connectionStrings>