DashboardDesigner.CustomDBSchemaProviderEx Property

Allows you to specify a custom schema for the SQL Data Source.

Namespace: DevExpress.DashboardWin

Assembly: DevExpress.Dashboard.v20.2.Win.dll


public IDBSchemaProviderEx CustomDBSchemaProviderEx { get; set; }

Property Value

Type Default Description


An object that implements the IDBSchemaProviderEx interface that provides a custom schema.


This example demonstrates how to customize a data store schema for a dashboard data source that uses a connection to the Northwind database.

In this example, the IDBSchemaProviderEx interface is implemented by a class that defines a custom data store schema containing two related tables. The IDBSchemaProviderEx.GetTables method returns tables and columns which will be included to a data store schema.

To see the result, add a new query or edit the existing query.

View Example

using DevExpress.DataAccess.ConnectionParameters;
using DevExpress.DataAccess.Sql;
using DevExpress.Xpo.DB;
using DevExpress.XtraBars.Ribbon;
using System.Collections.Specialized;

namespace Dashboard_CustomSchemaProvider {
    public partial class Form1 : RibbonForm {
        public Form1() {

            // Specifies a custom schema provider.
            dashboardDesigner1.CustomDBSchemaProviderEx = new CustomDBSchemaProvider();

            // Loads a dashboard from an XML file.

        // Creates a new class that defines a custom data store schema by implementing the 
        // IDBSchemaProvider interface.
        class CustomDBSchemaProvider : IDBSchemaProviderEx {
            DBTable[] tables;
            public void LoadColumns(SqlDataConnection connection, params DBTable[] tables) {
                foreach(DBTable table in tables) {
                    if(table.Name == "Categories" && table.Columns.Count == 0) {
                        DBColumn categoryIdColumn = new DBColumn { Name = "CategoryID" };
                        DBColumn categoryNameColumn = new DBColumn {Name = "CategoryName"};
                    if(table.Name == "Products" && table.Columns.Count == 0) {
                        DBColumn categoryIdColumn = new DBColumn { Name = "CategoryID" };
                        DBColumn productNameColumn = new DBColumn {Name = "ProductName"};

                        DBForeignKey foreignKey = new DBForeignKey(
                            new[] { categoryIdColumn },

            public static StringCollection CreatePrimaryKeys(params string[] names) {
                StringCollection collection = new StringCollection();
                return collection;

            public DBTable[] GetTables(SqlDataConnection connection, params string[] tableList) {
                var cp = connection.ConnectionParameters as Access97ConnectionParameters;
                if (cp != null && cp.FileName == @"..\..\Data\nwind.mdb") {
                    if (tables != null) {
                        return tables;
                    tables = new DBTable[2];

                    DBTable categoriesTable = new DBTable("Categories");
                    tables[0] = categoriesTable;

                    DBTable productsTable = new DBTable("Products");
                    tables[1] = productsTable;                  
                    tables = new DBTable[0];
                return tables;

            public DBTable[] GetViews(SqlDataConnection connection, params string[] viewList) {
                DBTable[] views = new DBTable[0];
                return views;

            public DBStoredProcedure[] GetProcedures(SqlDataConnection connection, params string[] procedureList) {
                DBStoredProcedure[] storedProcedures = new DBStoredProcedure[0];
                return storedProcedures;
See Also