Ticket T648219
Visible to All Users

Web - The "A connection string provider is not configured" error occurs after using the "Create data source..." command

created 7 years ago

Hello,
I have installed hotfix 18.1.3.18166 and I have the exception "The ConnectionStrings provider is not configured…" when create dashboard data source.
In attachment the exception image.

I hope you can help me with this issue.

Thank you,
Rossano

Comments (1)
P P
Pio Antonio Cartanese 7 years ago

    Same issue with v18.1.4

    Answers approved by DevExpress Support

    created 7 years ago (modified 3 years ago)

    Dashboard apps do not expose connection strings by default for security reasons. If you try to connect to a database without registering your connection strings, dashboards will throw "An error occurred on an attempt to load connection strings. A connection string provider is not configured".

    Clipboard-File-2.png

    Solution

    To allow end users to add data sources based on connection strings specified in the configuration file, register the connection strings as follows:

    1. Create an XAF ASP.NET WebForms application with the Dashboards Module.
    2. In the SolutionName.Module.Web project, add the following ViewController (for more information, refer to the attached project):
      C#
      namespace DashboardDataSource.Module.Web.Controllers { using DevExpress.DataAccess.Web; using DevExpress.ExpressApp; using DevExpress.ExpressApp.Dashboards.Web; using DevExpress.Persistent.Base; public class WebEnableConnectionStringsDashboardController : ObjectViewController<DetailView, IDashboardData> { protected override void OnActivated() { base.OnActivated(); View.CustomizeViewItemControl<WebDashboardViewerViewItem>(this, (viewItem) => { viewItem.DashboardControl.SetConnectionStringsProvider( new ConfigFileConnectionStringsProvider() ); }, "DashboardViewer"); } } }
    3. Run your Web app, navigate to the Reports | Dashboards item, create a new dashboard using the New Action. In the Dashboard Designer dialog, click the "Create data source…" link. Now you can select the Database and other data sources.

    Clipboard-File-1.png

    For more information on dashboard control customization, study the following concepts: How to: Access the Dashboard Control | CustomizeViewItemControl.

    Important Notes

    1. It's necessary to register this provider for a particular ASPxDashboard instance, NOT using DevExpress.DashboardWeb.DashboardConfigurator.Default.SetConnectionStringsProvider(new DevExpress.DataAccess.Web.ConfigFileConnectionStringsProvider()); in the Application_Start method (Global.asax).
    2. Do not use this code with predefined XAF dashboard data sources for dashboards, as described in the Create, View and Modify Dashboards in an ASP.NET Application topic.
    3. You can implement custom connection string providers using the IDataSourceWizardConnectionStringsProvider interface.
      Show previous comments (5)

        You guys need to update your Tutorial on creating a new dashboard project.
        https://www.youtube.com/watch?v=K4zaPGQ-YkU
        This is a link from this page:https://www.devexpress.com/Support/Demos/#dashboard How to Create a Web Designer and Viewer (ASP.NET MVC)
        We shouldn't have to go and search the web and try to find a way to fix it when following your tutorial.  While you are at it, you could update the tutorial as your current template is different and more options are there.

        For anyone else who has found this page when encountering this problem, add this code to the application_start
        DevExpress.DashboardWeb.DashboardConfigurator.Default.SetConnectionStringsProvider(new DevExpress.DataAccess.Web.ConfigFileConnectionStringsProvider());

        DevExpress Support Team 6 years ago

          Hello Fred,

          I've created a separate ticket on your behalf (T806658: Update the tutorial on creating a new dashboard project).

          J J
          Joche Ojeda - DevExpress MVP 4 years ago

            Hi Rossano
            if you are still interested on connect Db2 series I we have develop a XPO provider for it, you can read about it here

            https://www.bitframeworks.com/xpo-database-provider-customization/

            Also if you want to know more about our specialized provider you can schedule a meeting with us in the following link
            https://calendly.com/bitframeworks/bitframeworks-free-xaf-
            support-hour

            Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

            Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.