Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
10-02-2009, 12:19 AM #1
- Join Date
- Sep 2009
- Thanked 1 Time in 1 Post
Accessing Remote Database from Windows Form APP
I'm having a lot of trouble on a personal side project of mine connecting to a remote database from my windows form application.
Right now I am getting a
System.Data.SqlClient.SqlException A network related or instance specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible.
How do I know if my database is set up to allow remote connections?
Heres my code:
static SqlConnection connection;
string connectionString = "Server=name.db.5003672.hostedresource.com; Database=name; UId=name@IP; Password=password;";
connection = new SqlConnection(connectionString);
From my database page
Server: name.db.5003672.hostedresource.com (IP2 via TCP/IP)
the actual octets have obviously been changed to IP and IP2 and the name has been changed to name and password to password
I have also tried these changes to the connectionstring server
Hopefully anybody can have any type of insight for me, I am new to databases and connectionstrings in particular.
10-02-2009, 05:03 PM #2
- Join Date
- Jun 2002
- Thanked 328 Times in 324 Posts
Remote connections would be part of the server configuration. Furthermore, if the server is behind a firewall, you need to make sure that the port used for SQL Server is opened so you can connect in.
It probably isn't a problem with your connection string and a network or server configuration issue at the other end.OracleGuy
Users who have thanked oracleguy for this post: