Skip to main content

PivotGridAdomdDataSource.ConnectionString Property

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

Namespace: DevExpress.XtraPivotGrid

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

NuGet Packages: DevExpress.PivotGrid.Core, DevExpress.Win.Navigation

Declaration

public string ConnectionString { get; set; }

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.

Example

This example demonstrates how to add connection settings to the Adventure Works cube on the OLAP server.

View Example

To bind the Pivot Grid control to an OLAP cube, follow the steps below.

  1. Set the PivotGridControl.OLAPDataProvider property to ADOMD.
  2. Specify connection settings in the PivotGridControl.OLAPConnectionString property. The following connection string is used in this example:
    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;";
        }
    }
}
See Also