dashboard-devexpress-dot-dashboardweb-78823cfc.md
An in-memory storage of the dashboard data sources.
Namespace : DevExpress.DashboardWeb
Assembly : DevExpress.Dashboard.v25.2.Web.dll
NuGet Package : DevExpress.Web.Dashboard.Common
public class DataSourceInMemoryStorage :
IDataSourceStorage
Public Class DataSourceInMemoryStorage
Implements IDataSourceStorage
To create the storage of the dashboard data sources that will be available in the Web Dashboard’s UI for end-users, call the ASPxDashboard.SetDataSourceStorage / DashboardConfigurator.SetDataSourceStorage method. You can use a predefined implementation of the in-memory storage ( DataSourceInMemoryStorage ) or you can implement the IDataSourceStorage interface to provide a custom data source storage.
The following code snippet shows how to create the in-memory storage of data sources for the Web Dashboard control.
DashboardSqlDataSource sqlDataSource = new DashboardSqlDataSource("SQL Data Source", "sqlConnection");
SelectQuery countriesQuery = SelectQueryFluentBuilder
.AddTable("Countries")
.SelectColumns("Country", "Latitude", "Longitude", "Year", "EnergyType", "Production", "Import")
.Build("Countries");
sqlDataSource.Queries.Add(countriesQuery);
DashboardOlapDataSource olapDataSource = new DashboardOlapDataSource("OLAP Data Source", "olapConnection");
DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();
dataSourceStorage.RegisterDataSource("sqlDataSource1", sqlDataSource.SaveToXml());
dataSourceStorage.RegisterDataSource("olapDataSource1", olapDataSource.SaveToXml());
ASPxDashboard1.SetDataSourceStorage(dataSourceStorage);
Dim sqlDataSource As New DashboardSqlDataSource("SQL Data Source", "sqlConnection")
Dim countriesQuery As SelectQuery = SelectQueryFluentBuilder.AddTable("Countries").SelectColumns("Country", "Latitude", "Longitude", "Year", "EnergyType", "Production", "Import").Build("Countries")
sqlDataSource.Queries.Add(countriesQuery)
Dim olapDataSource As New DashboardOlapDataSource("OLAP Data Source", "olapConnection")
Dim dataSourceStorage As New DataSourceInMemoryStorage()
dataSourceStorage.RegisterDataSource("sqlDataSource1", sqlDataSource.SaveToXml())
dataSourceStorage.RegisterDataSource("olapDataSource1", olapDataSource.SaveToXml())
ASPxDashboard1.SetDataSourceStorage(dataSourceStorage)
Object DataSourceInMemoryStorage
See Also