I have created a Sql Server Managment Studio database, that is on Google Cloud virtual machine. Now i have C# winform app on a remote pc, and i am trying to retrive a table from that database. Virtual machine is Windows Server 2012R2 Datacenter. SSMS on virtual machine is 2014 and SQL Server 2014.
I get error in C# saying: The server was not found or was not accesible. Error 40- could not open a connection to SQL Server.
My connection string in C# is:
String strConnection=@"Data Source="Virtual machine IP"; Initial Catalog ="db
name"; User
ID="username";Password="password";";
Also i think i could connect to database on virtual machine, using my SSMS on my remote pc. I tried using IP address of virtual machine computer(ipconfig) and used username and password that i created in a VM SSMS. Also tried windows authetication with that ip. But everything with no succes. Error: The server was not found or was not accesible.
-I have allowed remote connections in SSMS.
-Have set SSMS login mode to mixed.
-Have set firewall exceptions on virtual machine for inbound rules, port TCP 1433, port UDP 1434, application sqlservr.exe, application sqlbrowser.exe
-On virtual machine in SQL Server Configuration Manager i have enabled TCP/IP, Named Pipes, Shared Memory
-SQL Server and SQL Browser are running on virtual machine.
If anyone has any ideas what to try next, i would be delightful.