Skip to main content
A newer version of this page is available. .

DataSource Class

OBSOLETE

The DataSource class is obsolete now. Use the DashboardSqlDataSource, DashboardOlapDataSource, DashboardEFDataSource and DashboardObjectDataSource classes instead.

A data source that provides data for the dashboard.

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v19.2.Core.dll

Declaration

[Obsolete("The DataSource class is obsolete now. Use the DashboardSqlDataSource, DashboardOlapDataSource, DashboardEFDataSource and DashboardObjectDataSource classes instead.")]
public class DataSource :
    DataSourceBase,
    IDashboardDataSourceInternal,
    IDashboardComponent,
    IComponent,
    IDisposable,
    ISupportInitialize,
    IDashboardDataSource,
    ISupportPrefix

Remarks

The DataSource objects are used to supply dashboards with data.

There are two primary approaches for creating data sources.

  1. Provide your data as a collection of records. This collection must implement the IEnumerable or IListSource interface. To assign this collection to a data source, pass it to the DataSource constructor or assign it to the DataSource.Data property. The examples below demonstrate this approach.

    How to: Bind a Dashboard to an Entity Framework Data Source

    How to: Bind a Dashboard to a List Object

    How to: Bind a Dashboard to a DataSet Populated from an XML File

  2. Create a data provider represented by the SqlDataProvider or OlapDataProvider classes. When creating a data provider, you can specify the connection parameters used to establish a connection to data. Then, pass the created provider to the DataSource constructor. The examples below demonstrate this approach.

    How to: Bind a Dashboard to a SQL Database using DashboardSqlDataSource

    How to: Bind a Dashboard to an OLAP Cube using DashboardOlapDataSource

Data-aware dashboard items have the DataDashboardItem.DataSource property that specifies a data source to which this item is actually bound.

A Dashboard also exposes the Dashboard.DataSources collection that contains data sources displayed within the Data Source Browser in the DashboardDesigner, so that end-users can use them when designing a dashboard.

Inheritance

Object
DevExpress.Utils.Controls.DisposableObject
DevExpress.DataAccess.DataSourceBase
DataSource
See Also