An error happened while reading data from the provider

In this Azure article, we will discuss the solution for the error: “an error happened while reading data from the provider: ‘could not load file or assembly ‘system.enterpriseservices, version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a’ or one of its dependencies. either a required impersonation level was not provided, or the provided impersonation level is invalid. (exception from hresult: 0x80070542)'”.

I could not connect to the Azure SQL database from Power BI, and I got this error.

An error happened while reading data from the provider

Recently, I was trying to connect to Azure SQL database from Power BI, But after clicking on the connect button, I got this error. The complete error message was as below

An error happened while reading data from the provider: ‘Could not load file or assembly ‘System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542)'”

You can see it here.

datasource.error an error happened while reading data from the provider

An error happened while reading data from the provider [Solution]

The solution for this issue is very simple. You need to make sure to run the Power BI Desktop application with Run as administrator mode and then try connecting the Azure SQL database from the Power BI Desktop again. The moment I did the same thing, I could successfully connect to the Azure SQL Database without any issues.

1. Right-click on Power BI Desktop and select Run as administrator mode.

power bi an error happened while reading data from the provider

2. Then try the same steps to connect the Azure SQL database from the Power BI Desktop application, and this time, you should be able to connect successfully.

You may also like following the articles below

Voila! it is so easy to solve the error “An error happened while reading data from the provider: ‘Could not load file or assembly ‘System.EnterpriseServices”. If you are facing the same issue, you can simply follow the above-mentioned instructions to fix the same issue. Thanks for reading this article. I hope this information will help you.