PivotGridAdomdDataSource.ConnectionString Property

Specifies a connection string to a cube in an MS Analysis Services database.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.PivotGrid.v20.2.Core.dll

Declaration

public string ConnectionString { get; set; }
Public Property ConnectionString As String

Property Value

Type Description
String

A connection string.

Remarks

Use the ConnectionString property to specify the connection string to a cube in an MS Analysis Services database. A sample connection string is shown below:

Provider=msolap;Data Source=localhost;Initial Catalog=Adventure Works DW;Cube Name=Adventure Works;Query Timeout=100;

The connection string has the following parameters:

  • Provider - Identifies a data provider to be used. The "msolap" string identifies the latest version of the ADOMD.NET provider.
  • Data Source - Specifies the name of a server that runs an instance of Microsoft SQL Server Analysis Services (SSAS).
  • Initial Catalog - Specifies a data catalog that contains cubes.
  • Cube Name - Specifies the name of a cube that provides OLAP data.
  • Query Timeout (optional) - The maximum amount of time, in seconds, to wait for a query to SSAS to complete. If the parameter is set to 0, each query can last for an indefinite time.

For a complete list of parameters that can be used in ADOMD.NET connection strings, see the AdomdConnection.ConnectionString MSDN topic.

To represent information from the bound cube, create specific PivotGridControl's fields, and bind them to the required fields in the data source.

See the Binding to OLAP Data Sources topic for more details.

Examples

The following example demonstrates how to bind a PivotGridControl to an OLAP cube via the ADOMD.NET data provider.

In this example, the PivotGridControl.OLAPDataProvider property is used to specify that the Pivot Grid Control should use the ADOMD.NET data provider to access an OLAP cube. OLAP connection parameters are specified in a connection string passed to the PivotGridControl.OLAPConnectionString property. The following parameters are provided:

  • Data Source - a path to a local cube file that will serve as a datasource.
  • Initial Catalog - a data catalog that contains cubes.
  • Cube Name - the name of the cube that provides OLAP data.
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;";
        }
    }
}
See Also