Back to Devexpress

DataSourceInMemoryStorage Class

dashboard-devexpress-dot-dashboardweb-78823cfc.md

latest3.8 KB
Original Source

DataSourceInMemoryStorage Class

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

Declaration

csharp
public class DataSourceInMemoryStorage :
    IDataSourceStorage
vb
Public Class DataSourceInMemoryStorage
    Implements IDataSourceStorage

Remarks

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.

Example

The following code snippet shows how to create the in-memory storage of data sources for the Web Dashboard control.

View Example

cs
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);
vb
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)

Implements

IDataSourceStorage

Inheritance

Object DataSourceInMemoryStorage

See Also

DataSourceInMemoryStorage Members

DevExpress.DashboardWeb Namespace