Connection to local SQL Server database works on emulator but fails on real device

后端 未结 2 576
一整个雨季
一整个雨季 2021-01-26 06:30

I am trying to connect to an SQL Server database that is currently hosted on my local machine. I am using the following code to connect:

public class DBConnect {         


        
2条回答
  •  天命终不由人
    2021-01-26 07:03

    Your problem might get solved by simply TURNING OFF the WINDOWS FIREWALL. Firewall will prevent your real device from establishing connection with your local MS SQL server. By doing so it worked fine for me.

    BUT since turning off firewall is not a good idea, configure the Windows Firewall for Database engine access, click this link and follow the steps.

    https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-a-windows-firewall-for-database-engine-access?view=sql-server-ver15

提交回复
热议问题