windowsforms-devexpress-dot-xtrapivotgrid-dot-pivotgridcontrol-041942fb.md
Specifies a connection string to a cube in an MS Analysis Services database.
Namespace : DevExpress.XtraPivotGrid
Assembly : DevExpress.XtraPivotGrid.v25.2.dll
NuGet Package : DevExpress.Win.PivotGrid
[DefaultValue(null)]
public string OLAPConnectionString { get; set; }
<DefaultValue(Nothing)>
Public Property OLAPConnectionString As String
| Type | Default | Description |
|---|---|---|
| String | null |
A String that specifies a connection string to a cube in an MS Analysis Services database.
|
To retrieve data from an OLAP cube asynchronously, use the PivotGridControl.SetOLAPConnectionStringAsync method to specify a connection string.
A sample connection string is shown below:
OLAPConnectionString="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 OLE DB 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, allowed for a query to SSAS to complete. If the parameter is set to 0, each query can last indefinitely.
At design time, a connection string can be built via the Connection String Editor. To open it, select the Pivot Grid Control in the Properties window, focus the cell corresponding to the OLAPConnectionString property, and click the ellipsis button.
To represent information from the bound cube, create specific Pivot Grid Control fields, and bind them to the required fields in the data source. You can use the designer’s Fields Page to do this.
If the OLAPConnectionString property is set to a valid string, the value of the PivotGridControl.DataSource property is cleared. Setting the PivotGridControl.DataSource property to a valid object clears the OLAPConnectionString.
See the Binding to OLAP Data Sources topic, for more details.
View Example: How to Connect the Pivot Grid to an OLAP Data Source at RuntimeView Example: How to Bind to an OLAP Cube with the ADOMD.NET Data ProviderView Example: How to Bind to an OLAP Cube with the XMLA Data Provider
The following code snippets (auto-collected from DevExpress Examples) contain references to the OLAPConnectionString property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-pivot-grid-connect-to-an-olap-datasource/CS/WinOlapRetrieveFieldsExample/Form1.cs#L10
pivotGridControl1.OLAPDataProvider = OLAPDataProvider.Adomd;
pivotGridControl1.OLAPConnectionString =
@"Provider=MSOLAP;
winforms-pivotgrid-bind-to-an-olap-cube-via-xmla/CS/XtraPivotGrid_XMLA/Form1.cs#L19
// required to access the desired OLAP cube.
pivotGridControl1.OLAPConnectionString =
"Data Source=http://demos.devexpress.com/Services/OLAP/msmdpump.dll;" +
// required to access the desired OLAP cube.
pivotGridControl1.OLAPConnectionString =
"Data Source=http://demos.devexpress.com/Services/OLAP/msmdpump.dll;" +
winforms-pivot-grid-connect-to-an-olap-datasource/VB/WinOlapRetrieveFieldsExample/Form1.vb#L13
pivotGridControl1.OLAPDataProvider = OLAPDataProvider.Adomd
pivotGridControl1.OLAPConnectionString = "Provider=MSOLAP;
Data Source=http://demos.devexpress.com/Services/OLAP/msmdpump.dll;
winforms-pivotgrid-bind-to-an-olap-cube-via-xmla/VB/XtraPivotGrid_XMLA/Form1.vb#L21
' 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
' 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
See Also