Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Jeanxyz
Post Prodigy
Post Prodigy

connect to SQL server fails

I have a Power BI report, which uses data from SQL data warehouse. The reports works when I run the query from my local PC or log into a  virtual machine using another user account. However, when I try to run the same report use my own account on the same virtual machine, I had an error message. By the way, I can access the same SQL database use my own account on that virtual machine. So assume both Power BI and SQL are functioning, it's something related to my account set upon that virtual machine. 

 

 

Has anyone enounter this before? 

sql error for community.PNG

 

1 ACCEPTED SOLUTION
James-Harpin
Resolver IV
Resolver IV

@Jeanxyz 

File - Options and settings - Data source settings

JamesHarpin_0-1657286281496.png

Then select your SQL database and select 'edit permisions' 

JamesHarpin_1-1657286388290.png

Selec Edit

JamesHarpin_2-1657286414959.png

And there you can change your connection type 

View solution in original post

6 REPLIES 6
v-luwang-msft
Community Support
Community Support

Hi @Jeanxyz ,

If you're getting this error after January 2022, possibly after migrating from System.Data.SqlClient to Microsoft.Data.SqlClient or just updating Microsoft.Data.SqlClient to version 4.0.0 or later, it's because MS has introduced a breaking change::

https://docs.microsoft.com/en-us/sql/connect/ado-net/introduction-microsoft-data-sqlclient-namespace...

Breaking changes in 4.0

Changed Encrypt connection string property to be true by default.

The default value of the Encrypt connection setting has been changed from false to true. With the growing use of cloud databases and the need to ensure those connections are secure, it's time for this backwards-compatibility-breaking change.

Ensure connections fail when encryption is required

In scenarios where client encryption libraries were disabled or unavailable, it was possible for unencrypted connections to be made when Encrypt was set to true or the server required encryption.

Rick Strahl has posted a detailed explanation on his blog

The change was made in this SqlClient pull-request in August 2021, where there is additional discussion about the change.

The quick-fix is to add Encrypt=False to your connection-strings.

 

 

Similar question refer:

https://stackoverflow.com/questions/17615260/the-certificate-chain-was-issued-by-an-authority-that-i...

https://community.powerbi.com/t5/Report-Server/Microsoft-SQL-A-connection-was-successfully-establish... 

https://community.powerbi.com/t5/Desktop/Error-while-connecting-to-SQL-database-after-PBI-last-updat... 

 

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

 

James-Harpin
Resolver IV
Resolver IV

@Jeanxyz 

File - Options and settings - Data source settings

JamesHarpin_0-1657286281496.png

Then select your SQL database and select 'edit permisions' 

JamesHarpin_1-1657286388290.png

Selec Edit

JamesHarpin_2-1657286414959.png

And there you can change your connection type 

Thank you  so much, James! the problem is solved now. It looks once I changed the connection from Microsoft to Windows, it changes the setup of other Power BI reports using the same SQL database.. 

James-Harpin
Resolver IV
Resolver IV

Hi @Jeanxyz 

Try changing your datasource setting from Microsoft Account to Windows Login then try to refresh data.

James-Harpin
Resolver IV
Resolver IV

Hi @Jeanxyz 

Try changing your datasource setting from Microsoft Account to Windows Login then try to refresh data.

@James-Harpin 

How to make the change in account? Do you have a post or printscreen?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.