Sunday, February 19, 2012

Connection string - Server vs Workstation

I have the following connection string in my Windows app that works fine on the Server:

workstation id=SCSXP;packet size=4096;integrated security=SSPI;data source=scsxp;persist security info=False;initial catalog=nala

But when I use that string on a workstation, it times out. I do have a Network connection to the Server.

How should I modify the connection string to work on the workstation?

Thanks,

Bill

Did you mean you got time out when you connect to the database server from another machine? How long before the time out raised? The default time out setting for connection string is 15 seconds. So try to add a Connection Timeout in connection string:
workstation id=SCSXP;packet size=4096;integrated security=SSPI;data source=scsxp;persist security info=False;initial catalog=nala; Connection Timeout=60


If it still timeouts, please first ensure you can ping the server with both server name and IP address. Then you can run 'telnet xxx.xx.xxx.xx 1433' to check the connection to 1433 TCP/IP port (used by default sql instance). If it fails, it means either the 1433 port is blocked or TCP/IP for SQL server is not enabled. You can use Network Library in connection string to specify another protocol, or enable TCP/IP on SQL Server. For more information about conneciton string, please see:


http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring.aspx

No comments:

Post a Comment