SqlDataProvider Class

Obsolete. Represents a data provider for regular data sources.

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v18.1.Core.dll

Declaration

[Obsolete("The SqlDataProvider class is obsolete now. Use the DashboardSqlDataSource class instead.")]
public class SqlDataProvider :
    SqlDataProviderBase,
    IPivotQueryExecutor
<Obsolete("The SqlDataProvider class is obsolete now. Use the DashboardSqlDataSource class instead.")>
Public Class SqlDataProvider
    Inherits SqlDataProviderBase
    Implements IPivotQueryExecutor

Examples

The following example demonstrates how to bind a dashboard to a SQL database using DashboardSqlDataSource.

DashboardSqlDataSource allows you to establish a connection to a data store by providing connection parameters and selecting required data by specifying a SQL query.

´╗┐Imports DevExpress.DashboardCommon
Imports DevExpress.DataAccess.ConnectionParameters
Imports DevExpress.DataAccess.Sql
Imports DevExpress.XtraBars.Ribbon

Namespace Dashboard_SqlDataProvider
    Partial Public Class Form1
        Inherits RibbonForm

        Public Sub New()
            InitializeComponent()
            dashboardDesigner1.CreateRibbon()

'            #Region "#SQLDataSource"
            Dim access97Params As New Access97ConnectionParameters()
            access97Params.FileName = "..\..\Data\nwind.mdb"

            Dim sqlDataSource As New DashboardSqlDataSource("SQL Data Source 1", access97Params)
            Dim selectQuery As SelectQuery = SelectQueryFluentBuilder.AddTable("SalesPerson"). _
                SelectColumns("CategoryName", "Sales Person", "OrderDate", "Extended Price").Build("Query 1")
            sqlDataSource.Queries.Add(selectQuery)
            sqlDataSource.Fill()

            dashboardDesigner1.Dashboard.DataSources.Add(sqlDataSource)
'            #End Region ' #SQLDataSource

            InitializeDashboardItems()
        End Sub

        Private Sub InitializeDashboardItems()
            Dim sqlDataSource As IDashboardDataSource = dashboardDesigner1.Dashboard.DataSources(0)

            Dim chart As New ChartDashboardItem()
            chart.DataSource = sqlDataSource
            chart.DataMember = "Query 1"
            chart.Arguments.Add(New Dimension("OrderDate", DateTimeGroupInterval.MonthYear))
            chart.Panes.Add(New ChartPane())
            Dim salesAmountSeries As New SimpleSeries(SimpleSeriesType.SplineArea)
            salesAmountSeries.Value = New Measure("Extended Price")
            chart.Panes(0).Series.Add(salesAmountSeries)

            Dim grid As New GridDashboardItem()
            grid.DataSource = sqlDataSource
            grid.DataMember = "Query 1"
            grid.Columns.Add(New GridDimensionColumn(New Dimension("Sales Person")))
            grid.Columns.Add(New GridMeasureColumn(New Measure("Extended Price")))

            dashboardDesigner1.Dashboard.Items.AddRange(chart, grid)
        End Sub
    End Class
End Namespace

Inheritance

Object
DevExpress.DashboardCommon.Native.SqlDataProviderBase
SqlDataProvider

Implements

DevExpress.PivotGrid.ServerMode.IPivotQueryExecutor

See Also