Connection String error while using ADOMD.NET to connect to Azure Analysis

后端 未结 2 750
旧时难觅i
旧时难觅i 2020-12-11 10:43

I am trying to retrieve data from Azure Analysis Services using ADOMD.NET from a deployed model in cloud. The code snippet is as below, but i am getting an error that the Co

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-11 11:03

    The first thing you need to do is to ensure you have the latest ADOMD.NET (AdomdClient) installed. Download it from here. After you have installed it, then make sure your C# project has a reference to it at:

    C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.AnalysisServices.AdomdClient\v4.0_13.0.0.0__89845dcd8080cc91\Microsoft.AnalysisServices.AdomdClient.dll

    Next, you need to change your connection string to:

    string connectionString = @"Data Source=asazure://westus.asazure.windows.net/bbacloud;User ID=user@domain.com;Password=pwdHere;Initial Catalog=DatabaseNameHere";
    

    Note a few things. First, it's User ID not UserName. Second, the user needs to be an Azure Active Directory user (an organizational account, not a personal LiveID). Finally, you need to specify the Initial Catalog to ensure that you connect to the correct database in case you ever have multiple databases deployed.

提交回复
热议问题