PivotGridControl.SetOLAPConnectionStringAsync(String, AsyncCompletedHandler) Method
Sets a connection string to a cube in an MS Analysis Services database, and loads data from the cube asynchronously. Allows you to specify custom actions to be performed after this operation is completed.
public void SetOLAPConnectionStringAsync( string olapConnectionString, AsyncCompletedHandler asyncCompleted )
Public Sub SetOLAPConnectionStringAsync( olapConnectionString As String, asyncCompleted As AsyncCompletedHandler )
A String that specifies the connection string to an OLAP cube.
A AsyncCompletedHandler delegate, referencing a method that should be executed after the operation is completed.
The SetOLAPConnectionStringAsync method is asynchronous. It starts executing the related operation in a background thread, and immediately returns control. The primary UI thread is not blocked, allowing the application to continue responding to end-user actions. For more information about the asynchronous mode, see Asynchronous Mode.
To load data from an OLAP cube synchronously, use the PivotGridControl.OLAPConnectionString property 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 Microsoft SQL Server Analysis Services (SSAS);
- Data Source - Specifies the name of a server that runs an instance of 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 for an indefinite time.