Register Default Data Sources
- 2 minutes to read
This document describes how to provide Dashboard Configurator with a set of default data sources available for end users.
User can create data sources at runtime after you register them in the Web Dashboard. The Web Dashboard supports the following data source types:
Call the DashboardConfigurator.SetDataSourceStorage method to register the created data source in data source storage. You can use a predefined implementation of the in-memory storage (DataSourceInMemoryStorage) or you can implement the IDataSourceStorage interface to create custom data source storage.
Protect User Data
The Web Dashboard saves user credentials used by data sources to the dashboard XML definition.
Use the DashboardConfigurator.PassCredentials property to specify whether to pass this information to the client side (web browser). Set this property to false
and provide connection parameters in one of the following ways to avoid any security issues:
- Add a connection string to the
connectionStrings
section in the configuration file (appsettings.json
for ASP.NET Core andWeb.config
for ASP.NET MVC). - Implement the IDataSourceWizardConnectionStringsProvider interface to create a data connections provider. Pass the created provider as the DashboardConfigurator.SetConnectionStringsProvider method's parameter.
- Handle the DashboardConfigurator.ConfigureDataConnection event to Specify the connection parameters at runtime.