corelibraries-devexpress-dot-xtrapivotgrid-683936d4.md
An ADOMD.NET datasource.
Namespace : DevExpress.XtraPivotGrid
Assembly : DevExpress.PivotGrid.v25.2.Core.dll
NuGet Packages : DevExpress.PivotGrid.Core, DevExpress.Win.Navigation
public class PivotGridAdomdDataSource :
OLAPDataSourceBase
Public Class PivotGridAdomdDataSource
Inherits OLAPDataSourceBase
The PivotGridAdomdDataSource class is obsolete. To bind a pivot grid to an OLAP cube via the ADOMD.NET data provider, set the pivot grid’s OLAPDataProvider property to Adomd and assign the connection string to the OLAPConnectionString property (see the example below).
To learn more, see Binding to OLAP Data Sources.
Note
When binding to local cubes , use either the OLE DB or ADOMD.NET provider, but not both. After you have established a connection using one of the providers, the other becomes unavailable in the current process. For instance, if you try to connect to a local cube via an OLE DB, disconnect and then connect again via ADOMD.NET to the same or another cube file from the same process, an exception will be thrown.
This example demonstrates how to add connection settings to the Adventure Works cube on the OLAP server.
To bind the Pivot Grid control to an OLAP cube, follow the steps below.
ADOMD.OLAPConnectionString = "Data Source=http://demos.devexpress.com/Services/OLAP/msmdpump.dll;" +
"Initial Catalog=Adventure Works DW Standard Edition;Cube Name=Adventure Works;"
Note that a valid connection string should include the following parameters: Provider, Data Source, Initial Catalog, and Cube Name.
using System;
using System.Windows.Forms;
using DevExpress.XtraPivotGrid;
namespace XtraPivotGrid_ADOMD {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
void Form1_Load(object sender, EventArgs e) {
// Specifies that PivotGridControl should use the ADOMD.NET data provider
// to bind to an OLAP cube.
pivotGridControl1.OLAPDataProvider = OLAPDataProvider.Adomd;
// Configures a data connection.
// Specifies a string that encapsulates connection parameters
// required to access the desired OLAP cube.
pivotGridControl1.OLAPConnectionString =
"Data Source=http://demos.devexpress.com/Services/OLAP/msmdpump.dll;" +
"Initial Catalog=Adventure Works DW Standard Edition;Cube Name=Adventure Works;";
}
}
}
Imports System
Imports System.Windows.Forms
Imports DevExpress.XtraPivotGrid
Namespace XtraPivotGrid_ADOMD
Public Partial Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
' Specifies that PivotGridControl should use the ADOMD.NET data provider
' to bind to an OLAP cube.
pivotGridControl1.OLAPDataProvider = OLAPDataProvider.Adomd
' Configures a data connection.
' Specifies a string that encapsulates connection parameters
' required to access the desired OLAP cube.
pivotGridControl1.OLAPConnectionString = "Data Source=http://demos.devexpress.com/Services/OLAP/msmdpump.dll;" & "Initial Catalog=Adventure Works DW Standard Edition;Cube Name=Adventure Works;"
End Sub
End Class
End Namespace
Object DevExpress.PivotGrid.QueryMode.QueryDataSource<DevExpress.PivotGrid.OLAP.OLAPCubeColumn> OLAPDataSourceBase PivotGridAdomdDataSource
See Also