[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Collapse]Dashboard
 [Expand]Getting Started
 [Expand]Basic Concepts and Terminology
 [Expand]Common Features
 [Collapse]Creating the Designer and Viewer Applications
  [Expand]WinForms Designer
  [Expand]WinForms Viewer
  [Collapse]Web Dashboard
    Web Dashboard Technical Overview
    Supported Browsers
    Required Client Libraries
   [Expand]ASP.NET Web Forms Dashboard Control
   [Collapse]ASP.NET MVC Dashboard Extension
     Server-Side API Overview
     Client-Side API Overview
     Integrate the Dashboard Extension into a Project
     Prepare a Dashboard Storage
     Register Default Data Sources
     Register Default Data Connections
     Designer and Viewer Modes
     Load a Dashboard
     Appearance Customization
     Manage Exporting Capabilities
     Manage Dashboard State
   [Expand]ASP.NET Core Dashboard Control
   [Expand]HTML JavaScript Dashboard Control
    Mobile Layout
   [Expand]Error Logging
    Security Considerations
    Microsoft Azure Specifics
   [Expand]UI Elements
  [Expand]WPF Viewer
  [Expand]Web Viewer
 [Expand]Creating Dashboards
 [Expand]Visual Studio Integration
  End-User Documentation
  Localization
 [Expand]Redistribution and Deployment
  Video Tutorials
 [Expand]Examples
 [Expand]Member Tables
 [Expand]API Reference
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Register Default Data Connections

This document describes how to provide a Web Dashboard with a set of predefined data connections. These connections will be displayed for end-users in the Dashboard Data Source Wizard when creating new Data Sources.

You can add a predefined connection in the following ways.

  • Add a connection string specifying a valid connection to the required database to the project's Web.config file as shown below. Note that the connection string should contain the XpoProvider parameter that depends on the used database type.

    To learn how to specify the XpoProvider parameter, see Custom Connection Strings for the SQL Data Source.

    Note that the Web Dashboard control does not pass connection string names to the client by default. Creating a new data source in the Data Source Wizard raises an exception on an attempt to load connection strings. Pass the ConfigFileConnectionStringsProvider instance as the DashboardConfigurator.SetConnectionStringsProvider method's parameter to allow creating new data sources based on connection strings from the Web.config file:

    Tip

    The Data Source wizard can display not only connection strings contained in the Web.config file but inherited connection strings, too (for instance, connection strings from machine.config). To remove such strings, add the clear element before the application's connection strings.

  • Specify a provider of data connections using the DashboardConfigurator.SetConnectionStringsProvider method.

    This example shows how to implement a custom provider of connection strings by implementing the IDataSourceWizardConnectionStringsProvider interface.

    After you have implemented a custom provider of connection strings, pass the instance of this class to the DashboardConfigurator.SetConnectionStringsProvider method.

Is this topic helpful?​​​​​​​