How to fix Microsoft.AnalysisServices.AdomdClient.AdomdConnectionException: ‘The connection string is not valid.’

Photo by Windows on Unsplash

This is a very common error that crops up when trying to use Microsoft’s AdomdConnection.

Assuming your connection string is valid (syntax can be viewed in Microsoft’s docs), and the Microsoft.AnalysisServices.AdomdClientnamespace is referenced in your project, the problem may be that you’re referencing theAdomdClient.dll file from the wrong directory.

To check where the dll file is being referenced:

  1. In Visual Studio, go to Project > Add Reference… > Browse
  2. Find Microsoft.AnalysisServices.AdomdClient.dll and check its path.

If the path begins with C:\Program Files, it’s likely the wrong dll file.

To update the file:

  1. In Visual Studio, go to Project > Add Reference… > Browse
  2. Click Browse… and navigate to C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.AnalysisServices.AdomdClient\v4.0_15.0.0.0))89845dcd8080cc91\Microsoft.AnalysisServices.AdomdClient.dll

Now, when running:

AdomdConnection conn = new AdomdConnection();

conn.ConnectionString = “Data Source=powerbi://api.powerbi.com/v1.0/myorg/Sales Work;UID=bi.sales@salesworkspace.com;PWD=Password123!;”;

conn.Open();

It should connect successfully.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store