Wrote a small program that uses a connection to SQL Server to create a database, create tables, populate tables, and queries to get data. The main problem occurs at the stage of connecting to the server (if the program is installed through the Microsoft Store, or as unpublished). Internally my program uses a string like "Server=myServerName\myInstanceName;Database=myDataBase;User Id=myUsername;Password=myPassword;". When I test the program on my personal computer, the connection succeeds and I have the ability to create a database and so on. But after I published the application in the store and installed it on a working computer, an error occurs when trying to connect to the server (for testing, I installed the SQL Server version for developers): "A network-related or instance-specific error occurred while establishing a connection to SQL Server "The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections (provider: TCP Provider, error: 25-Connection string is not valid)".
But the connection string is fine. Checked SQL Server Configuration Manager - Shared Memory , Named Pipes, TCP / ip have the Enabled status.
Used the ability to manually enter the connection string: "Data Source=18.104.22.168,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;" but this option doesn't work either.
What could be the reason? Services associated with the server - work, already tried to restart. Perhaps I am incorrectly determining the IP address, or problems with the port.