I have a virtual machine running on my PC running Windows Server 2008 with SQL Server 2012 installed. When I run SQL Server Management Studio on the VM I can connect as such:
Image showing Management Studio credentials
However, when I run the following C# code outside of the Virtual Machine (VMWare Player) I get an error saying that the server could not be found.
SqlConnection myConnection = new SqlConnection(@"Database=MyDB;Server=WIN-A7D3AQAEQ8C\SQLEXPRESS;Integrated Security=True;connect timeout = 7;");
Error:
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll
I can ping the Virtual Machine and vice versa. The Virtual Machine's firewall is turned off completely. What am I doing wrong?