When I use the Visual Studio 2010 Datasource designer to connect to my SQL server remotely everything works fine. However, if I try to connect programatically from the same project using this code (sensitive info X'd out):
SqlConnection conn = new SqlConnection();
conn.ConnectionString = "Data Source=\"XX.XXX.XXX.XXX, 1433\";User ID=ASPNET;Password=XXXXXXXX";
conn.Open();
I get the following error:
{"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: 0 - The requested service provider could not be loaded or initialized.)"}
port 1433 is open on the remote network and like I said I can browse the server fine through datasource designer. I'm using the same connection string as the designer in my code.