Reputation: 8225
I am trying to connect to a remote SQL server. I would like to know the proper way to connect to the server. TCP/IP protocol is enabled. I am trying this way:
@"Server=myserver.com\SQLEXPRESS; Database=mydatabase; User ID=user; password=pass"
I am using myserver.com
to connect to the server via RDP and I can connect without any problems, but when I am using the combination above to connect
to the SQL server via my code, it says that the server can't be found or does not exist.
Am I doing something wrong?
Upvotes: 4
Views: 40060
Reputation: 9153
May I introduce you to http://www.connectionstrings.com whenever I have to manually create a connection string that's my first port of call. I can tell you right now that you can't do SQLExpress from a remote client (at least not the last time I checked). But here is the page for SQL Server connection strings. If it works, then it'll be there
Edit It looks like you can connect remotely. It's just not configured that way out of the box
Upvotes: 5