开发者

What is the correct way to write server name for connecting a remote sql server?

In Visual Studio, I'm trying to connect to m开发者_JAVA技巧y staging db server.

In server name field, I've tried to fill with my server's ip address, but it didn't work.

I'm sure I've enabled access for the ip address in Sql Server configuration. My guess is that the server name was not properly set.

I've also tried myip/.SQLEXPRESS - also does not work.


Normal naming conventions for SQL Server used in Connection Strings:

http://www.connectionstrings.com/sql-server-2008

  • SERVERNAME, e.g. "myserver"
  • SERVERNAME\INSTANCENAME, e.g. "myserver\workgroup"
  • SERVERNAME,portnumber, e.g. "myserver,1999" if using non-standard ports
  • SERVERNAME\INSTANCENAME,portnumber

In each case, SERVERNAME can be replaced with the IP address, if the servername will not resolve or just as an alternative, e.g.

  • 165.24.21.225\SQLExpress,1999

In a connection string:

Driver={SQL Server Native Client 10.0};Server=165.24.21.225\SQLExpress,1999;Database=myDataBase;UID=mylogin;PWD=letmein;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜