Wednesday, 27 May 2015

Fetching data from SSAS cube in MVC 4.5

I need data in my mvc app coming from SSAS cube. I am not able to open the data source connection. Firstly i was extracting it using SQLClient Data provider using a sqlconnection. I was thrown a error <{"Cannot open database \"DataBASENAME\" requested by the login. The login failed.\r\nLogin failed for user 'Domain\user'."}>
Then I changed my provider TO MSOLAP.5 in connection string. Then also i am getting same error. After a research I came to know that namespace Microsoft.AnalysisServices.AdomdClient is used while connecting to analysis database. But I am not able to get the dll for it to make it a reference.
Please suggest with an example how to get it done. Requirement is data from SSAS cube needs to be fetched on MVC Application. please tell the name space and connection string and data flow if ever handled such situation. Thanks in Advance.

A Reply for connection string From DevMitra:
Connection String must be 
<add name="ConnectionStringName" connectionString="Data Source=ServerOrMachineName;Initial Catalog=DatabaseName;" providerName="MSOLAP.4" />

this is the correct string while data is need to be fetched from Analysis Services.


  1. First of all your connection string while fetching data from Microsoft Analysis services should be in the format given below

    This will be your connection string as described above.
    Now in database layer you will use namespace
    using Microsoft.AnalysisServices.AdomdClient;
    To set its reference you should browse to your C drive
    C:\Program Files\Microsoft.NET\ADOMD.NET\110
    In Directory select Microsoft.AnalysisServices.AdomdClient.dll
    that it. Now we are connected to our analysis services from our MVC Application.

  2. Connection string should be as written above only