Register Default Data Sources
- 2 minutes to read
This document describes how to provide a Web Dashboard with a set of default data sources available for end-users.
User can create the data sources at runtime. The Web Dashboard supports the following data source types:
- SQL data source
- OLAP data source
- Excel data source
- Object data source
- Entity Framework data source
- Extract data source
- JSON data source
- XPO data source
- Federated data source
After you create the data sources, use the DashboardConfigurator.SetDataSourceStorage method to register them in a data source storage. You can use a predefined implementation of the in-memory storage (DataSourceInMemoryStorage) or you can implement the IDataSourceStorage interface to provide custom data source storage. To see an example on how to do this, refer to the following topic: How to: Create an ASP.NET MVC Dashboard Designer Application with Predefined Data Sources.
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 the connection string to the connectionStrings section in the Web.config file and provide the connection parameters.
- 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 provide the connection parameters at runtime.